Trying to see how much time my code consumes, I tried the naive approach, calling clock()
in the beginning and at the end and comparing the values.
But when I include clock() on my code, it just breaks. The function wasn't even called. Why is that?
The code I'm trying:
clock_t begin, end;
begin = clock();
time_consuming_task();
end = clock();
printf("%f ms \n", ((float)(end - begin)) /16000000);