Skip to content

clok/tiny-timer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TinyTimer.pm

Very simple timer module for perl

SYNOPSIS

Simply create a new TinyTimer object:

my $timer = TinyTimer->new;

Then "start" and "stop" in your code for time deltas.

$timer->start;
.
.
<CODE>
.
.
$time->stop;

On "stop" the "delta" property is populated and can be used.

print $timer->delta;

Output:

0.0003447273118

That's it!

DESCRIPTION

###MAIN METHODS### ####new Constructor for TinyTimer

####start Starts a new timer at '0' ('Time::HiRes::time' populates the "start" property)

####stop Takes current time, 'Time::HiRes::time', and populates the "stop" property. This will also call "_delta"

####delta Returns the "delta" property.

####split Returns a split time from the last '_stop'. Will initiate a '_stop'.

####local Returns the "local" property generated by "_init".

###PRIVATE METHODS###

####_init Adds a localtime returned from date system call useful for reference to overall start time of scripts.

####_delta Takes the currently stored "start" & "stop" and calculates the delta. Populates the "delta" property. ####_split Takes the currently stored "_start" & "_stop" and calculates the delta. Populates the "_split" property.

AUTHOR

Derek Smith drsmith.phys--AT--gmail.com

About

Very simple timer module for perl

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages