31
General discussions / Switched times to Uint32 milliseconds in SFML 2
« on: November 05, 2011, 09:34:41 am »Quote from: "Laurent"
There will be a problem indeed, since 1.6 can't be returned (it will be 1 by the way, C++ truncates when it converts float to int).
What if my loop lasted shorter than 1 ms (0.9 ms), would it be truncated to 0 ms?
Also, if I ran a loop that would accumulate the elapsed time, the loop lasting 1,9 ms (displayed as 1 ms), after 1000 frames 1,9 second would have elapsed in reality, but the accumulated timer value would show 1 second! That's seriously crappy. In that case I would totally drop the frame timer and go for a global timer. Then the differences would be corrected, right?
What do you mean that OS guarantees 1ms as the smallest measurement? If so, then why was the float displaying non-round FPS values, like 1700 FPS?