| Class-Easy documentation | view source | Contained in the Class-Easy distribution. |
Class::Easy::Timer - really easy timer
SYNOPSIS
use Class::Easy;
# timer doesn't run without properly configured logger
logger ('default')->appender (*STDERR);
$t = timer ('sleep one second');
sleep (1);
my $interval = $t->lap ('one more second'); # $interval == 1
warn "your system have bad timer: 1s = ${interval}s"
if $interval < 1;
sleep (1);
$interval = $t->end; # $interval == 1
warn "your system have bad timer: 1s = ${interval}s"
if $interval < 1;
$interval = $t->total; # $interval == 2
create timer, start new lap and return timer object
get lap duration and start a new lap
get duration for last lap
get duration between timer creation and end call
Ivan Baktsheev, <apla at the-singlers.us>
Please report any bugs or feature requests to my email address, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Class-Easy. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
Copyright 2008-2009 Ivan Baktsheev
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
| Class-Easy documentation | view source | Contained in the Class-Easy distribution. |