TIMES

Section: Compatibility Functions (3C)
Updated: August 1, 1992
Index Return to Main Contents
 

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 Type
Member Name
clock_t
tms_utime      
clock_t
tms_stime
clock_t
tms_cutime
clock_t
tms_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)


 

Index

NAME
SYNOPSIS
DESCRIPTION
RETURN VALUE
SEE ALSO

This document was created by man2html, using the manual pages.
Time: 13:51:08 GMT, September 25, 2024