Article View: borland.public.delphi.nativeapi
Article #242Re: GetTickCount
From: Jeremy Collins
Date: Mon, 26 Jan 2004 10:27
Date: Mon, 26 Jan 2004 10:27
25 lines
1821 bytes
1821 bytes
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
Technical Details
Message-ID:
<4014eb74$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<4014e4e5@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f94dd,5baf55b70f2174fa X-Google-Attributes: gidf94dd,public X-Google-ArrivalTime: 2004-01-26 02:39:29 PST Date: Mon, 26 Jan 2004 10:27:01 +0000 From: Jeremy Collins <jd.collins@ntlworld-not.com> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: borland.public.delphi.nativeapi Subject: Re: GetTickCount References: <4014e4e5@newsgroups.borland.com> In-Reply-To: <4014e4e5@newsgroups.borland.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 81.101.19.29 Message-ID: <4014eb74$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1075112820 81.101.19.29 (26 Jan 2004 02:27:00 -0700) Lines: 25 Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail