times
Purpose
Gets process and child process times.
Syntax
#include <sys/types.h>
#include <sys/times.h>
time_t times (buffer)
struct tms *buffer;
Description
The times system call fills the structure pointed to by
the buffer parameter with time-accounting information.
All time values reported by the times system call are in
10ths of a second, unless execution profiling is enabled.
When profiling is enabled, times reports values in 60ths
of a second. (For more information about profiling, see
"profil," "monitor," and the cc and prof commands in AIX
Operating System Commands Reference.)
The tms structure is defined in sys/times.h and it con-
tains the following members:
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 exe-
cuted a wait system call.
tms_utime The CPU time used while executing
instructions in the user space of the
calling process.
tms_stime The CPU time used by the system on behalf
of the calling process.
tms_cutime The sum of the tms_utimes and the
tms_cutimes of the child processes.
tms_cstime The sum of the tms_stimes and the
tms_cstimes of the child processes.
Note: The system measures time by counting clock inter-
rupts. The precision of the values reported by the times
system call depends on the rate at which the clock inter-
rupts occur.
Return Value
Upon successful completion, the times system call returns
the elapsed real time, in 10ths of a second (60ths when
profiling), since an arbitrary reference time in the past
(for example, system start-up time). This reference time
does not change from one call of times to another. If
the times system call fails, a -1 is returned and errno
is set to indicate the error.
Diagnostics
The times system call fails if the following is true:
EFAULT The buffer parameter &pointsout..
Related Information
In this book: "exec: execl, execv, execle, execve,
execlp, execvp," "fork," "profil," "time," "wait," and
"monitor."
The cc and prof commands in AIX Operating System Commands
Reference.