DiaColloDB::Timer - diachronic collocation db, timer
##======================================================================== ## PRELIMINARIES use DiaColloDB::Timer; ##======================================================================== ## Constructors etc. $timer = $CLASS_OR_OBJECT->new(%args); ##======================================================================== ## Timing $timer = $CLASS_OR_OBJECT->start(); $timer = $timer->stop(); $timer = $timer->reset(); $elapsed = $timer->elapsed(); $hms = $timer->hms($sfmt?); $timestr = $timer->timestr($sfmt?);
DiaColloDB::Timer provides a simple object-oriented high resolution timer used e.g. for measuring query processing time in the command-line utilities.
$timer = CLASS_OR_OBJECT->new(%args);
%args, object structure:
started => $t0, ##-- time last operation started elapsed => $elapsed, ##-- elapsed time (after stop())
$timer = CLASS_OR_OBJECT->start();
(re-)starts timer
$timer = $timer->stop();
stops timer and adds current interval to {elapsed}
$timer = $timer->reset();
stops and re-sets timer
$elapsed = $timer->elapsed();
get total elapsed time for this timer
$hms = $timer->hms($sfmt?); ($h,$m,$s) = $timer->hms($sfmt?);
parses and optionally formats elapsed time as HH:MM:SS.SSS
$timestr = $timer->timestr($sfmt?);
parses and formats elapsed time as Hh?Mm?Ss
Bryan Jurish <moocow@cpan.org>
Copyright (C) 2015-2020 by Bryan Jurish
This package is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.14.2 or, at your option, any later version of Perl 5 you may have available.
DiaColloDB(3pm), perl(1), ...
To install DiaColloDB, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DiaColloDB
CPAN shell
perl -MCPAN -e shell install DiaColloDB
For more information on module installation, please visit the detailed CPAN module installation guide.