use Benchmark; # more iterations = more accuracy (but takes longer) # increase iterations if you get warnings like this: # (warning: too few iterations for a reliable count) $iterations = 10000; $name1 = "Test code 1"; # change name to something more decriptive $code1 = << 'END_CODE1'; # paste first block of code to test here END_CODE1 $name2 = "Test code 2"; # change name to something more decriptive $code2 = << 'END_CODE2'; # paste second block of code to test here END_CODE2 timethese($iterations, {$name1 => $code1, $name2 => $code2} );