use strict; use Benchmark; print "Starting..."; my $t0 = new Benchmark; # ... your code here ... sleep(3); my $t1 = new Benchmark; my $td = timediff($t1, $t0); print 'the code took:',timestr($td),"\n"; my $sec = timestr($td)+0; print "that's ",timestr($td)+0," seconds\n"; my $min = int($sec/60); $sec = $sec - $min*60; printf ("also known as %d:%02d", $min, $sec);