#include <time.h>
void sleep_seconds ( long seconds )
{
clock_t limit, now = clock();
limit = now + seconds * CLOCKS_PER_SEC;
while ( limit > now )
now = clock();
}
void sleep_ticks ( long ticks )
{
clock_t limit, now = clock();
limit = now + ticks;
while ( limit > now )
now = clock();
}
void wait(long milliseconds)
{
long timeout = clock() + milliseconds;
while( clock() < timeout )
continue;
}
[
本帖最后由 BlueGuy 于 2010-10-21 15:47 编辑 ]