The elapsed time is stored as a DWORD value. Therefore, the time will wrap around to zero if the system is run continuously for 49.7 days.

解决方案 »

  1.   

    how to do with the limit?
      

  2.   

    Just forget it at most time.
      

  3.   

    没有了,只是一个精度限制问题,可以参见MSDN中的Multimedia Timers
      

  4.   

    ULONG Start = GetTickCount();
    ....ULONG End = GetTickCounts();ULONG Dif = (End >= Start) ? End - Start : End + (0xffffffff - Start);
      

  5.   

    老A,End >= Start,仍有可能运行了超过49.7天。
      

  6.   

    GetTickCount的确只能用于简单的,过程式的方面。DWORD溢出是死问题,无解
    上面的方法仅仅是为了解决一个问题:void Func()
    {
          ULONG Start = GetTickCount();
          .... <<--- system wrap time counter to zero
         ULONG End = GetTickCounts();
         ULONG Dif = (End >= Start) ? End - Start : End + (0xffffffff - Start); 
    }也就是说,取start 和取end 之间正好处于49。7天的交界点,这样运算就错了,大多数函数不可能运行49。7天这么长的时间,我们不操心这个问题了。