Re: GetTickCount

From: Jeremy Collins (jd.collins_at_ntlworld-not.com)
Date: 01/26/04


Date: Mon, 26 Jan 2004 10:27:01 +0000

j.munk@XremoveXthisXmaccor.com wrote:

> I have a couple of application with some timing based on the "GetTickCount"
> API call. Since this function counts milliseconds since the PC was turned on
> and is a DWord it will roll over every 49.7 days. I would like to check this
> but rather than having my PC to run continously for 49.7 days, I wonder if
> there is anywhere where this number can be changed. I.e. so I can set it
> close and then see what happens with my programs when it rolls over.

Write your own GetTickCount that can return any value
you like, and perhaps use a conditional compile:

{$IFDEF DEBUG}
nRes := MyUtils.GetTickCount;
{$ELSE}
nRes := Windows.GetTickCount;
{$ENDIF}

Your "GetTickCount" could simply return the normal
GetTickCount value plus 48 days.

-- 
jc
Remove the -not from email


Relevant Pages

  • Re: SetTimer() question
    ... Of course, jiffies roll over ... > GetTickCount() assigned to start is 0xFFFFFF00 and "HowLong" is passed ... > get the desired elapsed time. ...
    (microsoft.public.vc.mfc)
  • Re: SetTimer() question
    ... For instance, imagine the value of ... GetTickCount() assigned to start is 0xFFFFFF00 and "HowLong" is passed ... The far WORSE case, however, would be if GetTickCount DID roll over, ... get the desired elapsed time. ...
    (microsoft.public.vc.mfc)
  • GetTickCount
    ... I have a couple of application with some timing based on the "GetTickCount" ... API call. ... Since this function counts milliseconds since the PC was turned on ... and is a DWord it will roll over every 49.7 days. ...
    (borland.public.delphi.nativeapi)