CLOCK(3C)
NAME
clock − report CPU time used
SYNOPSIS
#include <time.h>
clock_t clock ( )
DESCRIPTION
Clock returns the amount of CPU time (in microseconds) used since the first call to clock. The time reported is the sum of the user and system times of the calling process and its terminated child processes for which it has executed wait(2) or system(3S). To determine the time in seconds, the value returned by the clock function should be divided by the value of the macro CLOCKS_PER_SEC.
The resolution of the clock varies, depending on the hardware and on the software configuration.
If the processor time used is not available or its value cannot be represented, the function returns the value (clock_t)-1.
WARNINGS
The value returned by clock is defined in microseconds for compatibility with systems that have CPU clocks with much higher resolution. Because of this, the value returned will wrap around after accumulating only 2147 seconds of CPU time (about 36 minutes).
DEPENDENCIES
Series 300
The clock resolution is 20 milliseconds.
Series 800
The default clock resolution is 10 milliseconds.
SEE ALSO
times(2), wait(2), system(3S).
STANDARDS CONFORMANCE
clock: SVID2, XPG2, XPG3, ANSI C
Hewlett-Packard Company — HP-UX Release 7.0: Sept 1989