Friday, May 15, 2015

Easy way to count the processing time

#include <time.h>

clock_t time = clock();
...
time = clock()-time;
printf("time in seconds: %ds\n",time/CLOCKS_PER_SEC);
printf("time in milliseconds: %dms\n",time);

more details on clock

No comments:

Post a Comment