Determines the CPU time (in 10-millisecond units) used since the beginning of the process. The time reported is the sum of the user and system times of the calling process and any terminated child processes for which the calling process has executed wait or system.
#include <time.h> clock_t clock (void);
The type clock_t is defined in the <time.h> header file as follows:
typedef long int clock_t;
Only the accumulated times for child processes running a C main program or a program that calls VAXC$CRTL_INIT or DECC$CRTL_INIT are included.
A typical usage of the clock function is to call it after a program does its initial setup, and then again after the program executes the code to be timed. Then subtract the two values to give elapsed CPU time.
n | The processor time used. |
-1 | Indicates that the processor time used is not available. |