The Single UNIX ® Specification, Version 2
Copyright © 1997 The Open Group


times - get process and waited-for child process times


#include <sys/times.h>

clock_t times(struct tms *buffer);


The times() function fills the tms structure pointed to by buffer with time-accounting information. The structure tms is defined in <sys/times.h>.

All times are measured in terms of the number of clock ticks used.

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


Upon successful completion, times() returns the elapsed real time, in clock ticks, since an arbitrary point in the past (for example, system start-up time). This point does not change from one invocation of times() within the process to another. The return value may overflow the possible range of type clock_t. If times() fails, (clock_t)-1 is returned and errno is set to indicate the error.


No errors are defined.




Applications should use to determine the number of clock ticks per second as it may vary from system to system.




exec, fork(), sysconf(), time(), wait(), <sys/times.h>.


Derived from Issue 1 of the SVID.

UNIX ® is a registered Trademark of The Open Group.
Copyright © 1997 The Open Group
[ Main Index | XSH | XCU | XBD | XCURSES | XNS ]