Guard::Timer - a scope guard that keeps time
version 1.0.1
sub foo { my $guard = timer_guard { say "it took $_[0] seconds" }; do_a_thing; }
timer_guard
my $timer1 = timer_guard { ... }; my $timer2 = timer_guard \&logger, $precision;
Returns an object. When the object is destroyed, the given coderef is invoked with a single argument: the time elapsed between creation and destruction, to $precision decimals (defaults to 3).
$precision
Johan Lindstrom <Johan.Lindstrom@broadbean.com>
Gianni Ceccarelli <gianni.ceccarelli@broadbean.com>
This software is copyright (c) 2019 by BroadBean UK, a CareerBuilder Company.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Log::Timer, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Log::Timer
CPAN shell
perl -MCPAN -e shell install Log::Timer
For more information on module installation, please visit the detailed CPAN module installation guide.