The timer class is quite imprecise in its method of ensuring that the framerate does not exceed the user specified maximum. A better way of doing things is to sleep less through nanosleep than required and then wait the remaining time through busy waiting (e.g. while loop until target time reached).
The current sleepoverrun may still be useful though as it could help determine how early the busy waiting loop should start. Though the algorithm could use some improvements.
The timer class is quite imprecise in its method of ensuring that the framerate does not exceed the user specified maximum. A better way of doing things is to sleep less through nanosleep than required and then wait the remaining time through busy waiting (e.g. while loop until target time reached).
The current sleepoverrun may still be useful though as it could help determine how early the busy waiting loop should start. Though the algorithm could use some improvements.