⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tsecs

📁 减少内存碎片的malloc分配函数
💻
字号:
#!/usr/bin/perl## Little perl script which converts the time in epoch seconds into a# use viewable time/date.#use strict;use POSIX qw(strftime);sub usage {  print qq[Usage: tsecs [-h] [-f strftime-format] [epoch1 [epoch2 [...]]]  -h      Specify the times as hex values instead of decimal.  -f      Specify the strftime format string to use to display the time.  You can give a list times in epoch seconds to convert on the command line.  The time "now" will display the current date and secs.  If no times are given it will print out the current date and secs.];  exit 1;}my $now = time;@ARGV = ( $now ) unless @ARGV;my $time_format = "%a %b %e %H:%M:%S %Y %Z";my $hex_b = 0;my @times;while ( @ARGV ) {  $_ = shift;  /^-f/ && do { $time_format = shift || usage(); next; };  /^-h/ && do { $hex_b = 1; next; };  /^-/ && usage();  /^now$/ && do { $times[++$#times] = $now; next; };  $times[++$#times] = ($hex_b ? hex $_ : $_);}foreach my $secs ( @times ) {  my $time_str = strftime $time_format, localtime($secs);  print "Time in seconds for $secs is '$time_str'\n";}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -