Hello,
I'd like to register for a PAUSE account. The module I wish to submit is
Time::Timer, a simple object-oriented timer which uses Time::HiRes and
allows developers to simply benchmark portions of their code in a very
nonintrusive way. The SYNOPSIS is like this:
use Timer;
my $t = Timer->new;
$t->start('op1');
&long_running_operation1();
$t->stop;
$t->start('op2');
&long_running_operation2();
$t->stop;
$t->report;
Basically it takes care of wrapping those portions of code that you wish
to time with calls to gettimeofday() and tv_interval() from Time::HiRes.
The more useful part of the module is that you can aggregate statistics
just as easily. For example, if you wrapped the above in a loop:
use Timer;
my $t = Timer->new;
for(1 .. 1000) {
$t->start('op1');
&long_running_operation1();
$t->stop;
$t->start('op2');
&long_running_operation2();
$t->stop;
}
$t->report;
The Timer object automatically takes care of aggregating and averaging the
times that are recorded. There are methods to print the data in a report
form, or to return the data for your own processing or logging.
The module is available for download at the following URL:
http://www.zeuscat.com/andrew/src/Time-Timer-0.2.tar.gz
Here is the prerequisite information for PAUSE registration.
Name: Andrew Ho
E-mail: andrew (at) zeuscat.com
URL: http://www.zeuscat.com/andrew/
Preferred CPAN ID: ANDREW, HO, or ANDREWHO (preferred in that order)
Module description:
Name DSLI Description
----------- ---- --------------------------------------------
Time::Timer RdpO Perl code benchmarking tool
Although I haven't discussed this module extensively publically, there has
been some initial positive interest in response to my first post on
comp.lang.perl.modules. Also, I've used this module extensively at the
company I work at, and it has proven very useful for simple profiling of
production code in a minimally intrusive way.
Thanks in advance--
Humbly,
Andrew
-------------------------------------------------------------------------
'Twas brillig, and the slithy toves Andrew Ho
Did gyre and gimble in the wabe. [EMAIL PROTECTED]
All mimsy were the borogoves,
And the mome raths outgrabe. http://www.zeuscat.com/andrew/
-------------------------------------------------------------------------