Massyn has asked for the wisdom of the Perl Monks concerning the following question:
#!/fellow/monks.pl
I need to calculate how long it takes to do a particular task. The attached sample works for second intervals, however, I need to be able to count down to the milli second. How can I achieve that ?
#!/usr/bin/perl $start = time; sleep(2); #or some other crazy pieces of code $end = time; $length = $end - $start; print "It took us $length seconds to do the job.\n";
Thanks!
|\/| _. _ _ ._
| |(_|_>_>\/| |
/
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Count the milliseconds
by adrianh (Chancellor) on Mar 01, 2004 at 09:01 UTC | |
|
Re: Count the milliseconds
by BrowserUk (Patriarch) on Mar 01, 2004 at 09:29 UTC | |
|
Re: Count the milliseconds
by meetraz (Hermit) on Mar 01, 2004 at 21:52 UTC |