NAME

Class::Easy::Timer - really easy timer

ABSTRACT

SYNOPSIS

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

METHODS

new

create timer, start new lap and return timer object

lap

get lap duration and start a new lap

end

get duration for last lap

total

get duration between timer creation and end call

AUTHOR

Ivan Baktsheev, <apla at the-singlers.us>

BUGS

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.

SUPPORT

ACKNOWLEDGEMENTS

COPYRIGHT & LICENSE

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.