Find the answer to your Linux question:
Results 1 to 2 of 2
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Determining the running time of the command line application...

    I have a command line application that runs some complex fire simulations that could take many hours/days to run. Is there any way that I can determine how long the process ran. I have done something similar where, in PHP however, I take a starting timestamp and an ending timestamp and find the difference after running a command. Is there a way that I can do something similar from a shell script? I tried to do the above from a PHP page, but the simulation takes so long that the browser times out.

    Any ideas would be greatly appreciated.


  2. #2
    Linux Newbie
    Join Date
    Jan 2007
    Cupertino, CA
    From the manpage of the time command. See the actual manpage for more details:

    time - time a simple command or give resource usage

    time [options] command [arguments...]

    The time command runs the specified program command with the given arguments. When command finishes, time writes a
    message to standard error giving timing statistics about this program run. These statistics consist of (i) the
    elapsed real time between invocation and termination, (ii) the user CPU time (the sum of the tms_utime and
    tms_cutime values in a struct tms as returned by times(2)), and (iii) the system CPU time (the sum of the tms_stime
    and tms_cstime values in a struct tms as returned by times(2)).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts