#include <time.h> clock_t start,finish; start=clock(); ...... ...... finish=clock(); printf("%.3lf\n",((double)finish-start)/1000);