Waits a specified number of milliseconds or yields CPU.
This function waits for the specified number of milliseconds.
Passing 0 as parameter will not wait, but just yield. This can be useful
in order to "play nice" with other processes. Other values will cause
CPU time to be dropped on most platforms. This will look better to
users, and also does things like saving battery power and making fans
Note that calling this inside your active game loop is a bad idea, as
you never know when the OS will give you the CPU back, so you could end
up missing the vertical retrace and skipping frames. On the other hand,
on multitasking operating systems it is good form to give up the CPU for
a while if you will not be using it.
The following threads each have code containing this keyword:
Note: You can click on the numbers to jump directly to the posts that reference this page.
The following projects include source code containing this keyword: