CLOCK - determine processor time used.

(ANSI Standard)


#include <time.h>
clk = clock();


clock_t clk;
represents the number of clock "ticks" of processor time used by the program so far. The manifest CLOCKS_PER_SEC defined in <time.h> tells how many clock ticks there are in a second.


"clock" returns an approximation of how much processor time has been used by the program during execution. Timing may not begin precisely at the point that the program begins execution. However, during the execution of a program, all calls to "clock" will be relative to the same initial point -- the results of multiple calls can be compared.

Copyright © 1996, Thinkage Ltd.