Time.h
clock_t clock(void);returns approximation of number of CPU clock ticks since beginning of execution. Use clock()/CLOCKS_PER_SECONDto convert to seconds.
To measure time spent in program, call clock() at start of program, and its return value should be subtracted from subsequent calls.
time_t time(time_t *tptr);returns current calendar time.
char *asctime(const struct tm *tp);converts struct tm to a string, for printing
char *ctime(time_t *tptr);converts time_t tptr to a string, for printing
double difftime(time_t t0, time_t t1);returns t1-t0
Use two calls for time and then difftime to compute how long your program runs.