Benchmarking Your Code

in Perl Tips, Miscellaneous
by William Ward on September 6, 2002 6:28 pm

Perl’s motto is "There’s More Than One Way To Do It" but sometimes you may have trouble determining which is the best way to do it. Here’s one way to pick the best way: the Benchmark module.

The Benchmark module works by running your code many, many times and averaging the amount of time it took to run each one. It then reports on the total amount of time taken.

(more…)