可以加入对系统时间的判断,例如:
void wait(int ms) { unsigned long t = GetTickCount(); for (;;) { if (GetTickCount() - t >= ms) break; } }