in reply to Elapsed time in perl
The way you use to calculate the elapsed time is correct. You can use any of the various modules for date/time calculations to nicely format it in a human readable way.
Incidentally, almost by definitition, there's no need to create unnecessary temporary variable that are used once only:
Now, that is "simpler" - I also added a my, since you're use'ing strict anyway, don't you?my $sttime = time; sleep(60); print "Elapsed time : ", time - $sttime;
|
|---|