Prithu has asked for the wisdom of the Perl Monks concerning the following question:

Hi Gurus, I am new to perl and I am using Active State perl to write a script to benchmark few commands, I have some 20 commands running directly in the shell from a script. I want to know how much time each and every command takes to run. Is there any way I can get this. Please help cmd ( time , command)

Replies are listed 'Best First'.
Re: Timers for commands
by ccn (Vicar) on Oct 23, 2008 at 18:34 UTC
Re: Timers for commands
by JavaFan (Canon) on Oct 23, 2008 at 20:11 UTC
    perldoc -f times

      Contrary to the docs, times doesn't reflect the cpu used by child processes under win32:

      print times; system q[perl -e"$x = log( atan2(4,1)**($_**3)) for 1 .. 1e6"]; print times;; 0.062 0.062 0 0 0.062 0.062 0 0

      It could be made to, but it doesn't now.


      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.
        Thank You. I am trying with it.