times()

get time-accounting information 

Function


SYNOPSIS

#include <sys/types.h>

#include <sys/times.h>

clock_t times(struct tms *buffer);


DESCRIPTION

The times() function fills the structure pointed to by buffer with time-accounting information. 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 are included in its times.


PARAMETERS

buffer 

Points to the structure that the times() function fills with time-accounting information.


RETURN VALUES

If successful, times() returns the elapsed real time, in clock ticks, from an arbitrary point in the past (for example, since the system startup time). This point does not change from one invocation of times() within the process to another. The return value could overflow the possible range of type clock_t. On failure, times() returns -1 and sets errno to one of the following values:

EFAULT 

buffer is an invalid pointer.


CONFORMANCE

POSIX.1 (1996).


MULTITHREAD SAFETY LEVEL

MT-Safe.


PORTING ISSUES

None.


AVAILABILITY

PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Functions:
execl(), execle(), execlp(), execlpe(), execv(), execve(), execvp(), execvpe(), fork(), sysconf(), time(), wait(), waitpid()


PTC MKS Toolkit 10.4 Documentation Build 39.