Benchmark::Timer::Class - Perl module for timing the execution of methods in a specified object


Benchmark-Timer-Class documentation  | view source Contained in the Benchmark-Timer-Class distribution.

Index


NAME

Top

Benchmark::Timer::Class - Perl module for timing the execution of methods in a specified object

SYNOPSIS

Top

  use Benchmark::Timer::Class;
  use The_Real_Module;
  $obj = new The_Real_Module();
  $th  = new Benchmark::Timer::Class($obj);
  $th->method1_name_from_real_module();
  $th->method2_name_from_real_module();
  $th->method1_name_from_real_module();
  $th->report();

DESCRIPTION

Top

The Benchmark::Timer::Class enables you to determine elapsed times for calls to methods of a specified object during normal running of your program with minimal amount of editing.

Methods

$th = Benchmark::Timer::Class->new($original_object);

Takes an object reference and returns a reference to a Benchmark::Timer::Class object

$th->report;

Outputs a timing report to STDERR

$th->result($methodname);

Returns the mean time for all calls to method $methodname.

$th->results;

Returns the timing data as a hash keyed on object method names.

$th->data($methodname), $th->data;

When called with an $methodname returns the raw timing data as an array. When called with no arguments returns the raw timing data as hash keyed on object method names, where the values of the hash are lists of timings for calls to that object method.

AUTHOR

Top

D. Neil, <perl@dougneil.co.uk>

SEE ALSO

Top

Time::HiRes, Benchmark::Timer

COPYRIGHT

Top


Benchmark-Timer-Class documentation  | view source Contained in the Benchmark-Timer-Class distribution.