NAME

Nile::Timer - Timer to clock operations.

SYNOPSIS

# start the timer
$app->timer->start;

# do some operations...

# get time elapsed since start called
say $app->timer->lap;

# do some other operations...

# get time elapsed since last lap called
say $app->timer->lap;

# get another timer object, timer automatically starts
my $timer = $app->timer->new;
say $timer->lap;
#...
say $timer->lap;
#...
say $timer->total;

# get total time elapsed since start
say $app->timer->total;

DESCRIPTION

Nile::Timer - Timer to clock operations.

start()

# start the timer from now
$app->timer->start;

Starts the timer. Timer starts by default when the application is started.

lap()

say $app->timer->lap;

Returns the time period since the last lap or from the start if not called before.

total()

# get total time since start called
say $app->timer->total;

Returns the total time since the last start.

start_time()

say $app->timer->start_time;

Returns the last start time.

lap_start_time()

say $app->timer->lap_start_time;

Returns the last lap start time.

time()

say $app->timer->time;

Returns the current time.

Bugs

This project is available on github at https://github.com/mewsoft/Nile.

HOMEPAGE

Please visit the project's homepage at https://metacpan.org/release/Nile.

SOURCE

Source repository is at https://github.com/mewsoft/Nile.

SEE ALSO

See Nile for details about the complete framework.

AUTHOR

Ahmed Amin Elsheshtawy, احمد امين الششتاوى <mewsoft@cpan.org> Website: http://www.mewsoft.com

COPYRIGHT AND LICENSE

Copyright (C) 2014-2015 by Dr. Ahmed Amin Elsheshtawy احمد امين الششتاوى mewsoft@cpan.org, support@mewsoft.com, https://github.com/mewsoft/Nile, http://www.mewsoft.com

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.