CLOCK(3C) CLOCK(3C)
clock - report CPU time used
#include <time.h>
clock_t clock (void);
clock returns the amount of CPU time used since the first call to clock.
The unit time of clock (microseconds) is indicated in the macro
CLOCKS_PER_SEC found in the file <time.h>. 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), pclose(3S), or
system(3S).
The resolution of the clock is 10 milliseconds on IRIS workstations.
times(2), wait(2), popen(3S), system(3S).
The implementation of clock conflicts with the definition of the routine
found in the ANSI C Standard. The discrepancy will be transparent,
however, so long as programs which adhere to that Standard use the
difference in two invocations of clock for timing information, as
recommended by the Standard.
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).
PPPPaaaaggggeeee 1111 [ Back ]
|