Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

RE: RE: How can I keep track of the execution time of a script?

by Sarcasmo (Initiate)
on Oct 05, 2000 at 00:28 UTC ( #35328=note: print w/ replies, xml ) Need Help??


in reply to RE: How can I keep track of the execution time of a script?
in thread How can I keep track of the execution time of a script?

Thanks. That works nicely. How can I get that in milliseconds?


Comment on RE: RE: How can I keep track of the execution time of a script?
RE: RE: RE: How can I keep track of the execution time of a script?
by acid06 (Friar) on Oct 05, 2000 at 00:53 UTC
    If you're running this script in Windows you can use the Win32::GetTickCount to get the time in miliseconds I would do something like this:
    BEGIN { $ms = Win32::GetTickCount(); } END { warn 'This script took ',Win32::GetTickCount() - $ms,'miliseconds'; }
      This has several flaws. First, the tick count is not milliseconds. Second, that count could roll in the middle of your execution, yeilding a negative run time. (this happens roughly once a month) Also, it's OS dependant.

      I asked Sarcasmo what OS this was for, and the answer is Linux.

        Yes, it *is* OS dependant, as I said on the first line of my reply. However you're wrong about the tick count, at least according to the Win32 manpage:
        Win32::GetTickCount() [CORE] Returns the number of milliseconds elapsed since the last system boot. Resolution is limited to system timer ticks (about 10 +ms on WinNT and 55ms on Win9X).
        Its resolution is limited, however it is in miliseconds.
RE: RE: RE: How can I keep track of the execution time of a script?
by Adam (Vicar) on Oct 05, 2000 at 01:05 UTC
    There is a module that can get you high resoltion time stamps: Time::HiRes

    You should be able to take it from there.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://35328]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2015-07-06 00:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (68 votes), past polls