Perlでベンチマークをする場合は Benchmarkモジュールを 利用すると簡単にベンチマークを計ることができます。 サンプルコード #!/usr/local/bin/perl -w use strict; use warnings; use Benchmark; sub doit { my $sum = 0; foreach my $i(1..8000000) { $sum+=$i; } return $sum; } my ($t0, $t1, $td); $t0 = new Benchmark; doit(); $t1 = new Benchmark; $td = timediff($t1, $t0); print "the code took:",timestr($td),"\n"; % perl b1.pl the code took: 2 wallclock secs ( 2.