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;
In reply to Re: Elapsed time in perl
by blazar
in thread Elapsed time in perl
by nisha
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |