CLOCK(3) BSD CLOCK(3)
NAME
clock - report CPU time used
SYNOPSIS
#include <time.h>
clock_t clock(void)
DESCRIPTION
clock returns the amount of CPU time (in microseconds) used since the
first call to clock. This value is divided by CLOCKS_PER_SEC to
determine the number of seconds.
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(3), or system(3).
NOTES
Previous versions of this routine returned a long integer value.
However, the ANSI C type clock_t is defined in this implementation to be
a long integer, so backwards compatibility is preserved.
SEE ALSO
getrusage(2), wait(2), popen(3), system(3).
BUGS
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 (just over 35 minutes).