Header: Mmsystem.h.
Library: Winmm.lib.

解决方案 »

  1.   

    用timeGetTime()只是得到系统时间,用此函数来延时需要不停地得到时间来判断,不适用
    进行延时可用SetTimer()和TimerProc()两个函数配合即可,前者设置延迟时间,后者为到延迟时间后所要进行的处理,详细的使用方法可查MSDN。
      

  2.   

    VC不是有Sleep吗?!Sleep
    The Sleep function suspends the execution of the current thread for a specified interval. VOID Sleep(
      DWORD dwMilliseconds   // sleep time in milliseconds
    );
     
    Parameters
    dwMilliseconds 
    Specifies the time, in milliseconds, for which to suspend execution. A value of zero causes the thread to relinquish the remainder of its time slice to any other thread of equal priority that is ready to run. If there are no other threads of equal priority ready to run, the function returns immediately, and the thread continues execution. A value of INFINITE causes an infinite delay. 
    Return Values
    This function does not return a value.