int main(int argc, char const *argv[]) { clock_t begin = clock(); int j = 0; for(int i=0;i<500000;i++) j++; clock_t end = clock(); double time_spent = (double)(end - begin) / CLOCKS_PER_SEC; printf("%lf", time_spent); return 0; }