Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ times(2) — CX/UX 6.20

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

exec(2)

fork(2)

time(2)

wait(2)

times(2)

NAME

times − get process and child process times

SYNOPSIS

#include <sys/times.h>

clock_t times (buffer)
struct tms ∗buffer;

DESCRIPTION

times fills the structure pointed to by buffer with time-accounting information.  The following are the fields of this tms structure:

clock_ttms_utime;
clock_ttms_stime;
clock_ttms_cutime;
clock_ttms_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 in 60ths of a second.

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] times will fail if buffer points to an illegal address. 

RETURN VALUE

In the att universe, upon successful completion, times returns the elapsed real time, in 60ths of a second, since an arbitrary point in the past (e.g., 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.

In the ucb universe, if the call is successful 0 is returned, otherwise −1 is returned and the global variable errno contains the reason for the failure. 

NOTES

If the high resolution timing facility is configured into the currently executing kernel, tms_stime and tms_cstime will exclude or include time spent servicing interrupts, depending on what the system timing mode is set to. See hirestmode(2) and CX/UX Programmer’s Guide for more information on the high resolution timing facility. 

SEE ALSO

exec(2), fork(2), time(2), wait(2). 

CX/UX Programmer’s Reference Manual

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026