clock(3C)clock(3C)NAMEclock() - report CPU time used
returns the amount of CPU time (in microseconds) used since the first
call to 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 , or (see wait(2) , system(3S), and popen(3S)). To determine
the time in seconds, the value returned by should be divided by the
value of the macro
The resolution of the clock varies, depending on the hardware and on
If the processor time used is not available or its value cannot be rep‐
resented, the function returns the value
The value returned by is defined in microseconds for compatibility with
systems that have CPU clocks with much higher resolution. Because of
this, the value returned wraps around after accumulating only 4295 sec‐
onds of CPU time (about 72 minutes).
The default clock resolution is 10 milliseconds.
SEE ALSOtimes(2), wait(2), system(3S), thread_safety(5).