Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

time(1)

gettimeofday(2)

exec(2)

fork(2)

time(2)

wait(2)

TIMES(2)  —  HP-UX

NAME

times − get process and child process times

SYNOPSIS

#include <sys/types.h>
#include <sys/param.h>
#include <sys/times.h>

long times (buffer)
struct tms ∗buffer;

DESCRIPTION

Times fills the structure pointed to by buffer with time-accounting information.  The structure defined in sys/times.h is as follows:

struct tms {
time_ttms_utime;/* user time */
time_ttms_stime;/* system time */
time_ttms_cutime;/* user time, children */
time_ttms_cstime;/* system time, children */
};

This information comes from the calling process and each of its terminated child processes for which it has executed a wait. The times are in units of 1/HZ seconds, where HZ is processor dependent (see <sys/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.

ERRORS

­[EFAULT] Times will fail if buffer points to an illegal address.  The reliable detection of this error will be implementation dependent. 

HARDWARE DEPENDENCIES

Series 500:

For computers with multiple CPU’s, the child CPU times listed can be greater than the actual elapsed real time, since the CPU time is counted on a per-CPU basis.  Thus, if all three CPUs are executing, the CPU time is the sum of the three execution times of the CPUs. 

RETURN VALUE

Upon successful completion, times returns the elapsed real time, in units of 1/HZ 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. 

SEE ALSO

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

BUGS

Not all CPU time expended by system processes on behalf of a user process is counted in the system CPU time for that process. 

Hewlett-Packard Company  —  Version B.1,  May 11, 2021

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