[Nottingham] CPU time

Martin martin at ml1.co.uk
Fri Oct 17 20:40:00 UTC 2008


Michael Simms wrote:
> Erm, someone was asking how to get the CPU time of a process and/or its
> children. I just bumped into the times() function in section 2 of the
> manual, and it seems to do what people were looking for.

And there was also the idea of piping times from the children to the
parent process... Still awkward.

And from another thread:

####
The underlying problem is that no current OS has a system call that
returns the CPU time of a process and all its descendants. This info can
be obtained by enumerating all processes and tracing the process
ancestry, but this is time-consuming and I want to avoid doing it once
per second (the target refresh period for updating CPU time).
####


So really does noone/nothing provide an accurate 'progress' bar or 'time
so far' bar for a task spread across multiple parallel threads?

Cheers,
Martin

-- 
----------------
Martin Lomas
martin at ml1.co.uk
----------------



More information about the Nottingham mailing list