Find the answer to your Linux question:
Results 1 to 2 of 2
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 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jan 2007
    Posts
    2

    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.

    Thanks,
    Jim

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

    NAME
    time - time a simple command or give resource usage

    SYNOPSIS
    time [options] command [arguments...]

    DESCRIPTION
    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
  •