Is there a better way to determine elapsed time in Perl?

前端 未结 4 1416
囚心锁ツ
囚心锁ツ 2021-02-01 12:47
my $start_time = [Time::HiRes::gettimeofday()];
my $diff = Time::HiRes::tv_interval($start_time);

print \"\\n\\n$diff\\n\";
4条回答
  •  猫巷女王i
    2021-02-01 13:28

    That's pretty much it -- that will give you high resolution elapsed time. Unless, of course, someone messes with the system clock.

提交回复
热议问题