#!/usr/local/bin/perl # Jaime Prilusky, 2006 $|++; use Time::Elapse; Time::Elapse->lapse(my $now); # set the 'timer' before you start a process $now = "sleeping 1 sec"; # do something sleep(1); # show the time used print $now,"\n"; # changing $now's content resets the timer $now = "counting 1 .. 99999"; foreach $i ( 1 .. 99999) {} print $now,"\n"; $now = "calculating log 1 .. 99999"; foreach $i ( 1 .. 99999) { $tmp = log($i);} print $now,"\n";