Mega Code Archive

 
Categories / C / Development
 

How to check the performance

#include <time.h> #include <stdio.h> int main(void) {   time_t start,end;   volatile long unsigned t;   start = time(NULL);   for(t = 0; t < 5000000; t++)        ;   end = time(NULL);      printf("Loop used %f seconds.\n", difftime(end, start));   return 0; }