This is Time::Timer, a simple Perl code benchmarking tool. You can install it in the typical CPAN module manner: % perl Makefile.PL % make % make test # make install You can find the distribution at the following URL: http://www.zeuscat.com/andrew/src/Time-Timer-0.1.tar.gz Appended below is the POD documentation from Timer.pm. Contact Andrew Ho (andrew@zeuscat.com) with comments or bug reports. ======================================================================== NAME Time::Timer - Perl code benchmarking tool SYNOPSIS use Timer; $timer = Timer->new; for(my $i = 0; $i < 1000; $i++) { $timer->start('tag'); &long_running_operation(); $timer->stop; } $timer->report; DESCRIPTION The Timer class allows you to time portions of code conveniently, as well as benchmark code by allowing timings of repeated trials. It is perfect for when you need more precise information about the running time of portions of your code than the Benchmark module will give you, but don't want to go all out and profile your code. The methodology is simple; create a Timer object, and wrap portions of code that you want to benchmark with `start()' and `stop()' method calls. You supply a unique tag, or event name, to those methods. This allows one Timer object to benchmark many pieces of code. When you have run your code (one time or over multiple trials), you can obtain information about the running time by calling the `results()' method or print a descriptive benchmark report by calling `report()'. METHODS $timer = Timer->new; Constructor for the Timer object; returns a reference to a Timer object. Takes no arguments. $timer->reset; Reset the Timer object to the pristine state it started in. Erase all memory of events and any previously accumulated timings. Returns a reference to the Timer object. $timer->start($tag); Record the current time so that when `stop()' is called, we can calculate an elapsed time. Supply a $tag which is simply a string that is the descriptive name of the event you are timing. If you do not supply a $tag, the "_default" tag is used instead. $timer->stop($tag); Record timing information. The optional $tag is the event for which you are timing, and defaults to the $tag supplied to the last `start()' call. If a $tag is supplied, it must correspond to one given to a previously called `start()' call. $timer->report; Print a nice report on the collected timings to STDERR. BUGS Benchmarking is an inherently futile activity, fraught with uncertainty not dissimilar to that experienced in quantum mechanics. SEE ALSO the Benchmark manpage, the Time::HiRes manpage AUTHOR Andrew Ho COPYRIGHT Copyright(c) 2000-2001 Andrew Ho. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. ========================================================================