TIMES(2,L) AIX Technical Reference TIMES(2,L)
-------------------------------------------------------------------------------
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 units of CLK_TCK CLK_TCK is defined in <time.h>.
The tms structure is defined in sys/times.h and it contains the following
members:
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 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 interrupts. The precision of
the values reported by the times system call depends on the rate at
which the clock interrupts occur.
If the Transparent Computing Facility is installed, the reported times of a
process that has been subject to a remote exec or migrate system call only
reflect the time used since the process began running on the current site. The
accumulated times from the previous sites are included in the accumulated times
for child processes.
Processed November 7, 1990 TIMES(2,L) 1
TIMES(2,L) AIX Technical Reference TIMES(2,L)
RETURN VALUE
Upon successful completion, the times system call returns the elapsed real
time, in CLK_TCK units, 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.
ERROR CONDITIONS
The times system call fails if the following is true:
EFAULT The buffer parameter points to a location outside of the process's
allocated address space.
RELATED INFORMATION
In this book: "exec: execl, execv, execle, execve, execlp, execvp," "fork,
vfork," "monitor, monstartup, moncontrol," "profil," "sysconf," "time," and
"wait, waitpid."
The cc and prof commands in AIX Operating System Commands Reference.
Processed November 7, 1990 TIMES(2,L) 2