If you have been avoiding using Benchmark because the timethese functions sometimes look a bit complex this code is for you, just add your code and run.
tachyon
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} );
In reply to Benchmark made easy by tachyon
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |