Benchmark

Benchmark is a Perl module with benchmark running times of Perl code.
Download

Benchmark Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Jarkko Hietaniemi and Tim Bunce
  • Publisher web site:
  • http://search.cpan.org/~nwclark/

Benchmark Tags


Benchmark Description

Benchmark is a Perl module with benchmark running times of Perl code. Benchmark is a Perl module with benchmark running times of Perl code.SYNOPSIS use Benchmark qw(:all) ; timethis ($count, "code"); # Use Perl code in strings... timethese($count, { 'Name1' => '...code1...', 'Name2' => '...code2...', }); # ... or use subroutine references. timethese($count, { 'Name1' => sub { ...code1... }, 'Name2' => sub { ...code2... }, }); # cmpthese can be used both ways as well cmpthese($count, { 'Name1' => '...code1...', 'Name2' => '...code2...', }); cmpthese($count, { 'Name1' => sub { ...code1... }, 'Name2' => sub { ...code2... }, }); # ...or in two stages $results = timethese($count, { 'Name1' => sub { ...code1... }, 'Name2' => sub { ...code2... }, }, 'none' ); cmpthese( $results ) ; $t = timeit($count, '...other code...') print "$count loops of other code took:",timestr($t),"n"; $t = countit($time, '...other code...') $count = $t->iters ; print "$count loops of other code took:",timestr($t),"n"; # enable hires wallclock timing if possible use Benchmark ':hireswallclock';The Benchmark module encapsulates a number of routines to help you figure out how long it takes to execute some code.timethis - run a chunk of code several timestimethese - run several chunks of code several timescmpthese - print results of timethese as a comparison charttimeit - run a chunk of code and see how long it goescountit - see how many times a chunk of code runs in a given time Requirements: · Perl


Benchmark Related Software