Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ times(3C) — OPENSTEP 4.2

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

time(1)

exec(2)

fork(2)

sysconf(2P)

getrusage(2)

wait(2)

time(3C)

TIMES(3C)  —  UNIX Programmer’s Manual

NAME

times − get process times

SYNOPSIS

#include <sys/times.h>

clock_t times(struct tms ∗buffer);

DESCRIPTION

For non-POSIX applications this interface is obsoleted by getrusage(2). 

Times returns time-accounting information for the current process and for the terminated child processes of the current process.  All times are in 1/HZ seconds, where HZ is 60. 

The tms structure contains the following members:

Member TypeMember Name

clock_ttms_utime

clock_ttms_stime

clock_ttms_cutime

clock_ttms_cstime

The times of a terminated child process are included in the tms_cutime and tms_cstime members of the parent when a wait or waitpid function returns the process ID of this terminated child.  If a child process has not waited for its terminated children, their times are not included in its times. 

The value tms_utime is the CPU time charged for the execution of user intructions. 

The value tms_stime is the CPU time charged for execution by the system on behalf of the process. 

The value tms_cutime is the sum of the tms_utime’s s and tms_cutime’s of the child processes.

The value tms_cstime is the sum of the tms_stime s and tms_cstime s of the child processes. 

RETURN VALUE

Upon successful completion, times shall return the elapsed real time, in clock ticks.  If times fails, a value of (( clock_t )-1) is returned. 

SEE ALSO

time(1), exec(2), fork(2), sysconf(2P), getrusage(2), wait(2), time(3C)

4th Berkeley Distribution  —  August 1, 1992

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