App-timeput
view release on metacpan or search on metacpan
#!/usr/bin/perl
use 5.008 ; use strict ; use warnings ;
use Getopt::Std ;
use Getopt::Long qw [ GetOptions :config bundling no_ignore_case pass_through ] ; # GetOptionsFromArray ] ;
use Time::HiRes qw[ gettimeofday tv_interval sleep ] ; # Perl 5.7.3ããã³ã¢ã¢ã¸ã¥ã¼ã«
use Term::ANSIColor qw[ color :constants ] ; $Term::ANSIColor::AUTORESET = 1 ;
use FindBin qw[ $Script ] ;
sub FB ($){FAINT BOLD $_[0]}
sub Y ($){YELLOW $_[0]}
GetOptions 'sleep=f' => \my$sleep ;
getopts ".:b:c:dgsz:" , \my %o ;
my ($t0s,$t0p) = gettimeofday ; # ãèµ·åããæå»ãã®è¨é²ã15ãã¤ã¯ãç§ã®ãªã¼ãã¼ããã
$ENV{TZ} //= $o{z} ; # ã¿ã¤ã ã¾ã¼ã³
## Ctrl+Z æ¼ä¸ã«å¯¾ããåå¿ ã®æå®
sub cZ { say STDERR CYAN "$. line(s) output so far. ($Script $$)" ; $SIG{TSTP} ='DEFAULT' ; kill 'TSTP', $$ } ;
$SIG{TSTP} = sub { cZ } ;
( run in 1.700 second using v1.01-cache-2.11-cpan-97f6503c9c8 )