#include <sys/times.h> clock_t times(struct tms *buffer);
Times returns time-accounting information for the current process and for the terminated child processes of the current process. All times are in 1/HZ seconds, where HZ is 60.
The tms structure contains the following members:
The times of a terminated child process are included in the tms_cutime and tms_cstime members of the parent when a wait or waitpid function returns the process ID of this terminated child. If a child process has not waited for its terminated children, their times are not included in its times.
The value tms_utime is the CPU time charged for the execution of user intructions.
The value tms_stime is the CPU time charged for execution by the system on behalf of the process.
The value tms_cutime is the sum of the tms_utime's s and tms_cutime's of the child processes.
The value tms_cstime is the sum of the tms_stime s and tms_cstime s of the child processes.