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} );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Benchmark made easy
by bikeNomad (Priest) on Jun 16, 2001 at 02:54 UTC | |
|
Re: Benchmark made easy
by Anonymous Monk on Jun 15, 2001 at 23:55 UTC | |
by tachyon (Chancellor) on Jun 16, 2001 at 02:56 UTC |