Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^2: calculate the time taken to run a script

by Kanji (Parson)
on Nov 23, 2005 at 16:56 UTC ( #511175=note: print w/ replies, xml ) Need Help??


in reply to Re: calculate the time taken to run a script
in thread calculate the time taken to run a script

Perl already keeps track of start time for you in $^T, so unless you're doing something really funky, you can just subtract that from the current time to get elapsed time.

END { my $elapsed_seconds = time - $^T; # Do something with $elapsed_seconds # e.g., print qq(<!-- Script took ${elapsed_seconds}s to run -->); }

    --k.



Comment on Re^2: calculate the time taken to run a script
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (10)
As of 2015-07-05 08:54 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 (61 votes), past polls