use Benchmark; timethese(100000, { 'Test' => 'eval{die "x" x 100000 if $] < 5.01}', }); #### Benchmark: timing 100000 iterations of Test... Test: 15 wallclock secs (14.98 usr + 0.00 sys = 14.98 CPU) @ 6673.34/s (n=100000)) #### Benchmark: timing 100000 iterations of Test... Test: 0 wallclock secs ( 0.02 usr + 0.00 sys = 0.02 CPU) @ 6250000.00/ (n=100000) (warning: too few iterations for a reliable count)