Difftime Function
Syntax:
difftime(time_t time2, time_t time1);
Example:
#include <time.h> #include <stdio.h> int main() { time_t begin, end; volatile long unsigned t; begin = time(NULL); for(t=0;t<700; t++) ; end = time(NULL); printf("Loop used %f seconds.\n", difftime(end, begin)); return 0; }Back