in reply to time it took script to complete

Actually if you just want to count the seconds (or minutes, hours etc) you are better off using time() which returns purely the seconds since 1970. From that its easier to get minutes and hours:

my $t0 = time;
sleep(61);
my $t1 = time;
my $seconds = $t1 - $t0;
my $s = $seconds % 60;
my $m = ($seconds - $s) / 60;
print ("$m minutes and $s seconds\n");
# etc

Replies are listed 'Best First'.
Re^2: time it took script to complete
by tachyon (Chancellor) on Nov 07, 2004 at 22:20 UTC
    I think my $m = int($seconds/60) is cleaner and more self documenting personally.....