Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Lumio

macrumors member
Original poster
May 20, 2008
54
0
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 :)
 
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
 
hey thanks man :D

//edit:
Following result:
Code:
real	0m0.002s
user	0m0.001s
sys	0m0.002s

does that mean: 0m0.005s?
 
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
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.