Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)
OSS Library Calls (a - d) clock(3)
NAME
clock - Reports processor time used
LIBRARY
G-series native Guardian processes: $SYSTEM.SYSnn.ZCRTLSRL
G-series native OSS processes: /G/system/sysnn/zcrtlsrl
H-series and J-series native Guardian processes: $SYSTEM.ZDLLnnn.ZCRTLDLL
32-bit H-series and J-series OSS processes: /G/system/zdllnnn/zcrtldll
64-bit H-series and J-series OSS processes: /G/system/zdllnnn/ycrtldll
SYNOPSIS
#include <time.h>
clock_t clock(void);
DESCRIPTION
The clock( ) function reports the amount of processor time used by the calling process.
To measure the time spent in a process, call clock( ) at the start of the process and subtract its
return value from the value returned by subsequent calls to clock( ).
RETURN VALUES
The clock( ) function returns the amount of processor time (in microseconds) used since the first
call to clock( ). To determine the time in seconds, divide the value returned by clock( ) by the
value CLOCKS_PER_SEC.
RELATED INFORMATION
Functions: times(3), wait(2).
STANDARDS CONFORMANCE
The POSIX standards leave some features to the implementing vendor to define. In the HP imple-
mentation, the era used by the clock( ) function is 00:00:00 UTC, 1 January 1970.
527187-017 Hewlett-Packard Company 1−115