Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: =?iso-8859-1?Q?E=AE!k_\\/!$$E=AE?= Newsgroups: comp.lang.clipper.visual-objects Subject: Re: How to check if 1400 ms have passed? Date: Tue, 6 Sep 2011 10:30:56 +0200 Lines: 90 Message-ID: <9cm421Fs0bU1@mid.individual.net> References: <1qq76794pr6o8jqfmcepteronclarh2kkd@4ax.com> <9cm1edF6fmU1@mid.individual.net> <9cm3akFltgU1@mid.individual.net> <9cm3nkFnovU1@mid.individual.net> Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 8bit X-Trace: individual.net BTbYdzH1K4QvbHzb4tPUQgnWUnCPwVduJtJqWUD9LSniVsHfmu Cancel-Lock: sha1:ksX+aBgs4tijcaVnjDzvSI0IJM8= In-Reply-To: <9cm3nkFnovU1@mid.individual.net> X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Newsreader: Microsoft Windows Live Mail 15.4.3538.513 X-MimeOLE: Produced By Microsoft MimeOLE V15.4.3538.513 Xref: x330-a1.tempe.blueboxinc.net comp.lang.clipper.visual-objects:1958 Hi Karl, Ha! Should have read better. Anyway, the Win32 API function GetTickCount64() does not have this problem. Erik "Karl Wochele" schreef in bericht news:9cm3nkFnovU1@mid.individual.net... Hi Erik, there is no bug in the documentation as GetTickCount returns milliseconds and GetTickCountLow returns 1/10000 seconds. So this is where the factor 10 comes from... Karl Am 06.09.2011 10:18, schrieb EŽ!k \/!$$EŽ: >> So Robert (or whoever wrote this VO helppage) is about 10 times wrong >> here. > > Unfortunately this bug in the helpfile is already there in the VO 2.5 > docs, so most likely it wasn't Robert who wrote it. > > Erik > > > > > "EŽ!k \/!$$EŽ" schreef in bericht news:9cm1edF6fmU1@mid.individual.net... > > Hi Dick, > > I will not say the VO doc's lie about this, but they sure 'differ in > opinion' from the MS documentation. > Microsoft says: > "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. " > > And 49.7 x 24 x 3600 * 1000 = 4.294.080.000 Now that comes close to the > MaxDword value : 4.294.967.295 > So Robert (or whoever wrote this VO helppage) is about 10 times wrong > here. > > > But this is not as interesting as the rest of the MS documentation, as it > continues with: > > "To avoid this problem, use the GetTickCount64 function." > > > hth > > Erik > > > > > > > "D.J.W. van Kooten" schreef in bericht > news:1qq76794pr6o8jqfmcepteronclarh2kkd@4ax.com... > > In my bBrowser class, Dispatch, I have some code allowing the user to > autoseek while typing. For that the ideal waiting time until the > string is reset (e.g. because someone made a mistake and want to > start over) is 1400 ms. I used: > > nNow:=LONGINT(GetTickCountLow()) IF(nNow-SELF:nLastKeyPressTime>1400) > SELF:cSeek:="" > ENDIF > > But I read (after an error of course) that this gives a numeric > overflow error when Windows runs longer than 5 days (not very > elegantly handled I think).... > > > For now I replaced it with: > > nNow:=LONGINT(Secs(Time())) > which means the waiting time is either 1 seconds (just too short I > think) or 2 seconds, too long. But Secs() does not return > milliseconds. > > It's not really a big deal but does anyone know which function is > actually better suited to measure 1400 ms seconds bypassed without > giving runtime errors? > > Dick