How to relinquish processor cycles in wait functions
I'm trying to find an effective and accurate way for synching my framerate. If I use something like this:
then it will eat up 100% of the computer's processor time and cause the processor to heat up. I've also tried using the sleep function from the Win32 API:
while((curr_time - start_time) < 33)
; //wait and do nothing
It properly gives up unused processor cycles, but I don't know if it's entirely accurate when it comes to timing. Does anybody know any functions that I could use that are both accurate and aren't greedy for processor cycles?