我想测量在 perl 中执行某些功能所需的时间。我用过Time::HiRes
,但时间不可读。如何轻松实现?
代码是:
use Time::HiRes qw (time);
my $start = time;
my_function_here ();
my $time = time - $start;
printf "Time needed for my_function_here is: $time sec\n";
sub my_function_here {
my $null = 1;
}