Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Karl Wochele Newsgroups: comp.lang.clipper.visual-objects Subject: Re: How to check if 1400 ms have passed? Date: Mon, 05 Sep 2011 08:49:51 +0200 Lines: 37 Message-ID: <9cj9ofFa16U1@mid.individual.net> References: <1qq76794pr6o8jqfmcepteronclarh2kkd@4ax.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net IsyaRGhps6V5GIe2vi8EBg7qLhnAjSSKz0VxbTmdGulNgr2ZkH Cancel-Lock: sha1:YJHg7GZOAhX1lr4QvtG4LkFR4Vs= User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:6.0.1) Gecko/20110830 Thunderbird/6.0.1 In-Reply-To: <1qq76794pr6o8jqfmcepteronclarh2kkd@4ax.com> Xref: x330-a1.tempe.blueboxinc.net comp.lang.clipper.visual-objects:1944 Hi Dick, you can either use the windows-function GetTickCount() which will work for 49.7 days correctly or the VO-function seconds() instead of Secs(). Then you will get a float with milliseconds... Karl Am 04.09.2011 23:25, schrieb D.J.W. van Kooten: > 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 > >