The times() function fills the tms structure pointed to by buffer with time-accounting information. The tms structure,
defined in <sys/times.h>, contains the following members:
|
clock_t tms_utime;
clock_t tms_stime;
clock_t tms_cutime;
clock_t tms_cstime;
|
All times are reported in clock ticks. The specific value for a clock tick is defined by the variable CLK_TCK, found in the header <limits.h>.
The times of a terminated child process are included in the tms_cutime and tms_cstime members of the parent when wait(2) or waitpid(2) returns
the process ID of this terminated child. If a child process has not waited for its children, their times will not be included in its times.
The tms_utime member is the CPU time used while executing instructions in the user space of the calling process.
The tms_stime member is the CPU time used by the system on behalf of the calling process.
The tms_cutime member is the sum of the tms_utime and the tms_cutime of the child processes.
The tms_cstime member is the sum of the tms_stime and the tms_cstime of the child processes.
|