#include <time.h> clock_t startTime = clock(); for (int n = 0; n < 1000000; n++) { //.. } clock_t endTime = clock(); double seconds = (endTime - startTime) / 1000.0f; printf("%.5f\n", seconds);