程序中设定了一个定时器,每10秒钟激活一个操作,发现偶尔的要隔一分多种才会执行该操作,请问是什么原因导致定时器的延时 

解决方案 »

  1.   

    你定时器在线程中比Suspend了?你用什么定时器啊?SetTimer?
      

  2.   

    Settimer不怎么准时。
    一个sleep就能停了
      

  3.   

    The WM_TIMER message is a low-priority message. The GetMessage and PeekMessage functions post this message only when no other higher-priority messages are in the thread's message queue. 
      

  4.   

    需要用Windows多媒体定时器,精度可以达到1ms
      

  5.   

    windows产生的WM_TIMER常规定时器,只能提供大于等于55ms的精确定时。
    用多媒体定时器,精度可以达到1ms:
    百度一下:主要要用到这两个函数:QueryPerformanceFrequency
    QueryPerformanceCounter。
      

  6.   

    同意楼上的,windows多媒体定时器,主要用到这两个函数,QueryPerformanceFrequency,QueryPerformanceCounter百度一下,有用法。