times(2)times(2)NAMEtimes - get process and child process timesSYNOPSISDESCRIPTION
fills the structure pointed to by buffer with time-accounting informa‐
tion. The structure defined in is as follows:
struct tms {
clock_t tms_utime; /* user time */
clock_t tms_stime; /* system time */"
clock_t tms_cutime; /* user time, children */
clock_t tms_cstime; /* system time, children */
};
This information comes from the calling process and each of its termi‐
nated child processes for which it has executed a or The times are in
units of 1/seconds, where is processor dependent. The value of can be
queried using the function (see sysconf(2)).
is the CPU time used while executing instructions in the user space of
the calling process.
is the CPU time used by the system on behalf of the calling process.
is the sum of the and of the child processes.
is the sum of the and of the child processes.
RETURN VALUE
Upon successful completion, returns the elapsed real time, in units of
1/of a second, since an arbitrary point in the past (such as system
start-up time). This point does not change from one invocation of to
another. If fails, (clock_t) −1 is returned and is set to indicate the
error.
Remarks
has a granularity of one tick. Processes which run less than one tick
may not register any value.
ERRORS
fails if buffer points to an illegal address. The reliable
detection of this error is implementation dependent.
WARNINGS
Not all CPU time expended by system processes on behalf of a user
process is counted in the system CPU time for that process.
SEE ALSOtime(1), exec(2), fork(2), gettimeofday(2), sysconf(2), time(2),
wait(2).
STANDARDS CONFORMANCEtimes(2)