Doug Neil > Benchmark-Timer-Class > Benchmark::Timer::Class

Download:
Benchmark-Timer-Class-0.02.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.02   Source  

NAME ^

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

SYNOPSIS ^

  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 ^

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 ^

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

SEE ALSO ^

Time::HiRes, Benchmark::Timer

COPYRIGHT ^

Copyright(c) 2001 Doug Neil.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

syntax highlighting: