Main > Programming > Libraries >

Time::Elapse 1.2402

Time::Elapse 1.2402

Sponsored Links

Time::Elapse 1.2402 Ranking & Summary

RankingClick at the star to rank
Ranking Level
User Review: 0 (0 times)
File size: 0.007 MB
Platform: Any Platform
License: Perl Artistic License
Price:
Downloads: 928
Date added: 2007-04-10
Publisher: Scott R. Godin

Time::Elapse 1.2402 description

Time::Elapse is a Perl extension for monitoring time conveniently during tasks.

Time::Elapse is a very simple class with one method: lapse.

Basically, the lapse method eats the brains of the variable, squirrels away whatever value it may have held internally, (much like space aliens are known to do in the movies), and also stores the current time within it. Then, whenever you access the value of the variable, the alien within formats the time differential between when you initialized the variable, and when you printed it, and returns that (along with any value the variable may hold, as well). :-) Every time you print it, you get the updated differential, returned by the method hidden inside the variable itself. The output will be formatted as HH:MM:SS.000000 [in Microseconds].

Frankly it doesnt do much more than time(), but then again the simplest things rarely do.

All it really does is hides the calculations that anyone else would have had to set up manually in a clever way and then produce a reasonably formatted output which lends itself equally well to single-line output or inlining with other text.

SYNOPSIS

Usage

To use Elapse is simplicity itself:

use Time::Elapse;

# somewhere in your program...
Time::Elapse->lapse(my $now);
# or you can do:
# Time::Elapse->lapse(my $now = "processing");

#...rest of program execution

print "Time Wasted: $nown";

To update the description and reset the time counter mid-stream, simply assign to the variable

$now = "parsing";

somewhere in the middle of the program. The new value is stored, while the original time is replaced with the current time.

Sample Output

Output looks something like this, using above code:

Time Wasted: 00:00:05.565763
or
Time Wasted: 00:00:03.016700 [processing]
(more output)
Time Wasted: 00:00:02.003764 [parsing]

Additional example code

You can also use this during a Net::FTP download loop of files to show elapsed time for each files download.

foreach my $file (@files_to_download)
{
# extract localfile name from $file
# ...
Time::Elapse->lapse(my $now = "Downloading $localfile.");
$ftp->get($file, $localfile) or carp("### Could not download $file! $!") and next;
print "Done. Elapsed : $nown";
# ...
}

This can also be a useful trick when youre processing a lot of data from multiple sources.

Time::Elapse 1.2402 Screenshot

Advertisements

Time::Elapse 1.2402 Keywords

Bookmark Time::Elapse 1.2402

Hyperlink code:
Link for forum:

Time::Elapse 1.2402 Copyright

WareSeeker periodically updates pricing and software information of Time::Elapse 1.2402 full version from the publisher, so some information may be slightly out-of-date. You should confirm all information before relying on it. Software piracy is theft, Using crack, password, serial numbers, registration codes, key generators is illegal and prevent future development of Time::Elapse 1.2402 Edition. Download links are directly from our publisher sites, torrent files or links from rapidshare.com, yousendit.com or megaupload.com are not allowed

Allok Video Splitter 2.2.0 Review:

Name (Required)
Email(Required)
Captcha
Featured Software

Want to place your software product here?
Please contact us for consideration.

Contact WareSeeker.com
Related Software
Text::MetaText is a Perl extension implementing meta-language for processing "template" text files. Free Download
Search::Glimpse is a Perl extension to communicate with Glimpse server. Free Download
GD::Map is Perl extension for creating geographic map files with GD. Free Download
CGI::Cache is a Perl extension to help cache output of time-intensive CGI scripts. Free Download
CGI::FastTemplate is a Perl extension for managing templates, and performing variable interpolation. Free Download
WML::Card is a Perl extension for builiding WML Cards according to the browser being used. Free Download
Sub::Timebound is a Perl extension for timebound computations. Free Download
Math::BaseArith is a Perl extension for mixed-base number representation (like APL encode/decode). Free Download