times function returns more detailed information about
elapsed processor time in a
struct tms object. You should
include the header file `sys/times.h' to use this facility.
tmsstructure is used to return information about process times. It contains at least the following members:
tms_utimevalues and the
tms_cutimevalues of all terminated child processes of the calling process, whose status has been reported to the parent process by
waitpid; see section Process Completion. In other words, it represents the total CPU time used in executing the instructions of all the terminated child processes of the calling process, excluding child processes which have not yet been reported by
tms_cutime, but represents the total CPU time used by the system on behalf of all the terminated child processes of the calling process.
All of the times are given in clock ticks. These are absolute values; in a newly created process, they are all zero. See section Creating a Process.
timesfunction stores the processor time information for the calling process in buffer.
The return value is the same as the value of
clock(): the elapsed
real time relative to an arbitrary base. The base is a constant within a
particular process, and typically represents the time since system
start-up. A value of
(clock_t)(-1) is returned to indicate failure.
Portability Note: The
clock function described in
section Basic CPU Time Inquiry, is specified by the ISO C standard. The
times function is a feature of POSIX.1. In the GNU system, the
value returned by the
clock function is equivalent to the sum of
tms_stime fields returned by
Go to the first, previous, next, last section, table of contents.