Node:Processor Time, Previous:CPU Time, Up:Processor And CPU Time
The times
function returns information about a process'
consumption of processor time in a struct tms
object, in
addition to the process' CPU time. See Time Basics. You should
include the header file sys/times.h
to use this facility.
struct tms | Data Type |
The tms structure is used to return information about process
times. It contains at least the following members:
All of the times are given in numbers of clock ticks. Unlike CPU time, these are the actual amounts of time; not relative to any event. See Creating a Process. |
clock_t times (struct tms *buffer) | Function |
The times function stores the processor time information for
the calling process in buffer.
The return value is the calling process' CPU time (the same value you
get from |
Portability Note: The clock
function described in
CPU Time is specified by the ISO C standard. The
times
function is a feature of POSIX.1. In the GNU system, the
CPU time is defined to be equivalent to the sum of the tms_utime
and tms_stime
fields returned by times
.