- Wait a specified number of milliseconds
SDL_Delay() allows you to wait for some number of
milliseconds.
Since the operating systems supported by SDL are
multi-tasking, there is no way to guarantee that your
application will delay exactly the requested time.
This should be used more as a way of idling for a
while rather than to wake up at a particular time.
|
Tip:
Most operating systems have a scheduler timeslice of
about 10 ms. You can use SDL_Delay(1) as a way of giving
up CPU for the current timeslice, allowing other threads
to run. This is important if you have a thread in a tight
loop but want other threads (like audio) to keep running. |