Quote:Original post by CTarQuote:Original post by Sr_GuapoQuote:Original post by pulpfist
I guess your right.
How about a yield call in Windows API? Is there such a thing?
It is called "Sleep()". Just use that function and pass the number of milliseconds. I have no idea if it is windows only or anything (I'll look it up in a second).
It's Windows only and you shouldn't just pass it a number of MS. Sleep(0) is about the same as a yield. You shouldn't pass anything greater unless you wait for a very long time. Sleep(1) often results in more than 10ms waits, which is completely unacceptable.
EDIT: Also you shouldn't use yield unless you can see you are rendering way too much (>150 FPS, at least). imagine slowing your game down 3% when the user already have low-end hardware.
Thank you for the clarification. I knew it was often longer than you specify, but I didn't realize it was that bad...