I have the following code:
clock_t tt = clock();
sleep(10);
tt = clock()-tt;
cout<<(float)tt/CLOCKS_PER_SEC<<" "<<CLOCKS_PER_SEC<<endl;
When I run the code, it apparently pauses for 10 seconds and the output is:
0.001074 1000000
This indicates it passed 1074 clock ticks and 1ms, which is apparently false.
Why does this happen?
I am using g++ under linux.