Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When using time some_executable - the system and user CPU time returned actually includes all the CPU time of any child processes launched by the named executable (this was news to me, actually).

I would like to get just the CPU time incurred by the launched process, however, and not its children. Is that possible?

share|improve this question
    
from man time: Note: some shells (e.g., bash(1)) have a built-in time command that provides less functionality than the command described here. To access the real command, you may need to specify its pathname (something like /usr/bin/time). I had to install time, but its output is way more verbose (than the built in time), maybe it helps you. – Baarn Jul 25 '12 at 21:37

If you are benchmarking a piece of software, you can get VERY fine-grained results with something like callgrind (valgrind --tool=callgrind).

If you're looking for something a tad weaker, /proc/$PID/schedstat contains useful numbers (such as "time this thread has used").

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .