- or download this
Benchmark: timing 5000000 iterations of sub1, sub2, sub3...
sub1: 8 wallclock secs @ 664805.21/s (n=5000000)
sub2: 6 wallclock secs @ 988924.05/s (n=5000000)
sub3: 4 wallclock secs @ 1139731.02/s (n=5000000)
- or download this
use Benchmark;
...
my $codehash = {'sub1' => \&sub1,'sub2' => \&sub2,'sub3' => \&sub3};
timethese(5000000, $codehash);
- or download this
Benchmark: timing 5000000 iterations of sub1, sub2, sub3...
sub1: 8 wallclock secs ( 7.49 usr + 0.00 sys = 7.49 CPU) @ 66
+7467.63/s (n=5000000)
sub2: 7 wallclock secs ( 7.27 usr + -0.01 sys = 7.26 CPU) @ 68
+8800.11/s (n=5000000)
sub3: 5 wallclock secs ( 5.12 usr + 0.01 sys = 5.13 CPU) @ 97
+5419.43/s (n=5000000)