Sleep threads in SDL?

Is there a way to let a thread sleep in SDL? for example, how to implement
something like:

while(!done) {
…//handle events.

Uint32 timeElapsed = lastUpdateTime - SDL_GetTicks();
if (timeElapsed < 30) {
…//sleep for 30 - timeElapsed milliseconds.
}
redraw();
lastUpdateTime = SDL_GetTicks();
}

Thank you!

Will Childman wrote:

Is there a way to let a thread sleep in SDL? for example, how to implement
something like:

while(!done) {
…//handle events.

Uint32 timeElapsed = lastUpdateTime - SDL_GetTicks();
if (timeElapsed < 30) {
…//sleep for 30 - timeElapsed milliseconds.
}
redraw();
lastUpdateTime = SDL_GetTicks();
}

SDL_Delay ?

Stephane

Is there a way to let a thread sleep in SDL?

You want SDL_Delay()

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment