LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Finding out how long a program takes to execute (https://www.linuxquestions.org/questions/linux-software-2/finding-out-how-long-a-program-takes-to-execute-250755/)

nodger 11-03-2004 03:58 PM

Finding out how long a program takes to execute
 
Is there any command in Linux that I can use to measure the execution time (in milli or micro seconds) of a program?

Bebo 11-03-2004 04:00 PM

time? :)

shengchieh 11-03-2004 05:31 PM

You want time outside or inside the program?

If inside, read the docs for whatever programming
language you're using. I know there are docs for
g77, gcc, and g++. I don't know what programming
languge you are using. For example, in fortran,
you define an array, say INTEGER tick(2), then
use etime, dtime, or wahtever to find the time
of a particular program section. I'm sure there are
similiar stuffs for other languages.

If outside, use a script w/ time before and after
the program, i.e.,

#/bin/sh
time
<your program>
time

Sheng-Chieh


All times are GMT -5. The time now is 11:07 AM.