#include <sys/times.h> #include <limits.h>
clock_t times(struct tms *buffer);
clock_t tms_utime; clock_t tms_stime; clock_t tms_cutime; clock_t tms_cstime;
This information comes from the calling process and each of its terminated child processes for which it has executed a wait routine. 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>.
tms_utime is the CPU time used while executing instructions in the user space of the calling process.
tms_stime is the CPU time used by the system on behalf of the calling process.
tms_cutime is the sum of the tms_utime and the tms_cutime of the child processes.
tms_cstime is the sum of the tms_stime and the tms_cstime of the child processes.
times() fails if: