In MSDN, the check for the clock function is defined as follows:
clock_t clock (void);
Returns the time that the program consumes the CPU from startup to function calls. This function returns the number of CPU clock ticks (clock ticks) from "Open this program process" to "call clock () function in program", called Wall Clock Time (Wal-clock) in MSDN, and returns 1 if the wall clock time is not desirable.
Where clock_t is the data type used to hold the time, it is defined as follows
#ifndef _clock_t_definedtypedef long clock_t; #define _CLOCK_T_DEFINED#ENDIF in the time.h file, a constant clocks_per_sec is also defined. It is used to indicate how many clock units are in a second, defined as follows: #define CLOCKS_PER_SEC ((clock_t) 1000) every 1 per thousand seconds (1 milliseconds), the value returned by the call to the clock () function is added 1. You can use the clock function to calculate how long it takes for your machine to run a loop or handle other events: clock_t start, end;double clocktime;
start = Clock ();
....... functions.
end = Clock ();
Clocktime = (double) (End-start))/clocks_per_sec;
clocking function clock () in C and C + +