View Full Version : Finding out how long a programm takes time
Lumio
Sep 3, 2009, 08:44 AM
Hi,
I'm programming a little tool for one of my clients with C++..
ok, this question hasn't really to do with it, but anyway.
Does anybody know, how I can test, how long it takes to proceed? All with Terminal :)
lee1210
Sep 3, 2009, 08:57 AM
The 'time' command
Result:
>time ls
Desktop ...
real 0m0.008s
user 0m0.001s
sys 0m0.004s
If you need input use < to direct a file prepared with the desired input to stdin to avoid human delay.
-Lee
Lumio
Sep 3, 2009, 09:06 AM
hey thanks man :D
//edit:
Following result:
real 0m0.002s
user 0m0.001s
sys 0m0.002s
does that mean: 0m0.005s?
lee1210
Sep 3, 2009, 09:15 AM
user is how much time is spent in your code (that is, running and not in the kernel on your program's behalf).
sys is the time the kernel spend on your program's behalf.
real is time on a wall clock spent. The others shouldn't really exceed this, but when you're dealing with thousandths of a second there might be some wiggle room.
-Lee
vBulletin® v3.8.6, Copyright ©2000-2012, Jelsoft Enterprises Ltd.