#include <stdio.h> #include <time.h> clock_t start = clock(); /* Code you want timed here */ printf("Time elapsed: %f\n", ((double)clock() - start) / CLOCKS_PER_SEC);