LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   how can I measure how much real time is used to run an executable? (https://www.linuxquestions.org/questions/linux-general-1/how-can-i-measure-how-much-real-time-is-used-to-run-an-executable-310645/)

markhod 04-07-2005 05:09 AM

how can I measure how much real time is used to run an executable?
 
Hello,

Basically I want to see how long it takes my executable to run with different parameters used in one of the algorithms. Is there a way to e.g. submit it to the background (I can do this) AND set a timer going which will stop when the executable finishes running?

I dont want to sit with a stopwatch watching...

Cheers,

Mark

__J 04-07-2005 05:41 AM

you mean like the time command?

$time { slocate glib.h; }
/usr/share/gtk-doc/html/glib/glib.html
/usr/include/mozilla-1.7.5/jpeg/jpeglib.h
/usr/include/dbus-1.0/dbus/dbus-glib.h
/usr/include/glib-1.2/glib.h
/usr/include/glib-2.0/glib.h
/usr/include/jpeglib.h
/usr/include/taglib/taglib.h
/home/moody/apps/linux-2.6.11.6/drivers/isdn/hardware/eicon/debuglib.h
/home/moody/gnome-1.4/include/glib-1.2/glib.h

real 0m1.025s
user 0m0.080s
sys 0m0.010s

**********************************88

note that the semicolon in the above command is not a typo.
you can also chain commands together like:

time { xxx && xxx && xxxx && xxxx; }


All times are GMT -5. The time now is 12:35 AM.