TIMES(S) UNIX System V TIMES(S)
Name
times - get process and child process times
Syntax
#include <sys/types.h>
#include <sys/times.h>
long times (buffer)
struct tms *buffer;
Description
The times system call fills the structure pointed to by
buffer with time-accounting information. The following are
the contents of this structure:
struct tms {
time_t tms_utime;
time_t tms_stime;
time_t tms_cutime;
time_t tms_cstime;
};
This information comes from the calling process and each of
its terminated child processes for which it has executed a
wait. All times are reported in clock ticks per second.
Clock ticks are a system-dependent parameter. The specific
value for an implementation is defined by the variable HZ,
found in the include file param.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_utimes and tms_cutimes of
the child processes.
tms_cstime is the sum of the tms_stimes and tms_cstimes of
the child processes.
[EFAULT] The times system call will fail if buffer points
to an illegal address.
See Also
exec(S), fork(S), time(S), wait(S)
Diagnostics
Upon successful completion, times returns the elapsed real
time, in clock ticks per second, from an arbitrary point in
the past (for example, system start-up time). This point
does not change from one invocation of times to another. If
times fails, a -1 is returned and errno is set to indicate
the error. Clock ticks occur 100 times per second.
Standards Conformance
times is conformant with:
AT&T SVID Issue 2, Select Code 307-127;
The X/Open Portability Guide II of January 1987;
IEEE POSIX Std 1003.1-1988 with C Standard Language-
Dependent System Support;
and NIST FIPS 151-1.
(printed 6/20/89)