times

Gets CPU time-accounting information for executing instructions.

Library:LibC
Classification:POSIX
Service:Time

Syntax

  #include <sys/times.h> 
   
  clock_t times (
     struct tms   *buffer);
  

Parameters

buffer

(IN) Points to the tms structure that is filled with time information.

Return Values

If successful, 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.

If unsuccessful, returns -1 and sets errno to indicate the error.

Remarks

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

The tms_utime field in the tms structure is the CPU time charged for execution of user instructions in the calling process.

The tms_stime field in the tms structure is the CPU time charged for execution by the system on behalf of the calling process. On NetWare®, this is identical to tms_utime.

The tms_cutime and tms_cstime structure members have not been implemented.

See Also