計算程式碼執行時間
use Time::HiRes qw( time );
my $start = time();
#Code for which execution time is calculated
sleep(1.2);
my $end = time();
printf("Execution Time: %0.02f s\n", $end - $start);
這將以秒為單位列印程式碼的執行時間
use Time::HiRes qw( time );
my $start = time();
#Code for which execution time is calculated
sleep(1.2);
my $end = time();
printf("Execution Time: %0.02f s\n", $end - $start);
這將以秒為單位列印程式碼的執行時間