Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.clipper.visual-objects > #1940 > unrolled thread

How to check if 1400 ms have passed?

Started byD.J.W. van Kooten <public@ic2remove.this.com>
First post2011-09-04 23:25 +0200
Last post2011-09-06 08:15 +0000
Articles 2 on this page of 22 — 9 participants

Back to article view | Back to comp.lang.clipper.visual-objects


Contents

  How to check if 1400 ms have passed? D.J.W. van Kooten <public@ic2remove.this.com> - 2011-09-04 23:25 +0200
    Re: How to check if 1400 ms have passed? dlzc <dlzc1@cox.net> - 2011-09-04 14:50 -0700
      Re: How to check if 1400 ms have passed? D.J.W. van Kooten <public@ic2remove.this.com> - 2011-09-05 08:51 +0200
        Re: How to check if 1400 ms have passed? dlzc <dlzc1@cox.net> - 2011-09-05 12:05 -0700
          Re: How to check if 1400 ms have passed? "Willie Moore" <williem@wmconsulting.com> - 2011-09-05 15:10 -0500
            Re: How to check if 1400 ms have passed? D.J.W. van Kooten <public@ic2remove.this.com> - 2011-09-06 11:13 +0200
        Re: How to check if 1400 ms have passed? malcolm gray <malcolm.gray@ntlworld.com> - 2011-09-06 11:32 +0100
    Re: How to check if 1400 ms have passed? "Bernhard Mayer" <Idonotexisthere@nowhere.com> - 2011-09-05 07:32 +0200
      Re: How to check if 1400 ms have passed? D.J.W. van Kooten <public@ic2remove.this.com> - 2011-09-05 08:48 +0200
    Re: How to check if 1400 ms have passed? Karl Wochele <kw@e©os-system.de> - 2011-09-05 08:49 +0200
      Re: How to check if 1400 ms have passed? D.J.W. van Kooten <public@ic2remove.this.com> - 2011-09-05 13:16 +0200
        Re: How to check if 1400 ms have passed? Karl Wochele <kw@e©os-system.de> - 2011-09-05 13:42 +0200
          Re: How to check if 1400 ms have passed? D.J.W. van Kooten <public@ic2remove.this.com> - 2011-09-05 15:14 +0200
            Re: How to check if 1400 ms have passed? Karl Wochele <kw@e©os-system.de> - 2011-09-05 15:27 +0200
              Re: How to check if 1400 ms have passed? D.J.W. van Kooten <public@ic2remove.this.com> - 2011-09-06 10:57 +0200
    Re: How to check if 1400 ms have passed? E®!k \\/!$$E® <nospam@nospam.url> - 2011-09-06 09:46 +0200
      Re: How to check if 1400 ms have passed? E®!k \\/!$$E® <nospam@nospam.url> - 2011-09-06 10:18 +0200
        Re: How to check if 1400 ms have passed? Karl Wochele <kw@e©os-system.de> - 2011-09-06 10:25 +0200
          Re: How to check if 1400 ms have passed? E®!k \\/!$$E® <nospam@nospam.url> - 2011-09-06 10:30 +0200
      Re: How to check if 1400 ms have passed? Karl Faller <k.faller_withoutthat_@onlinehome.de> - 2011-09-06 10:29 +0200
        Re: How to check if 1400 ms have passed? E®!k \\/!$$E® <nospam@nospam.url> - 2011-09-06 10:47 +0200
    Re: How to check if 1400 ms have passed? "Dirk (Belgium)" <dirk.dot.herijgers@pbprojects.dot.be> - 2011-09-06 08:15 +0000

Page 2 of 2 — ← Prev page 1 [2]


#1959

FromE®!k \\/!$$E® <nospam@nospam.url>
Date2011-09-06 10:47 +0200
Message-ID<9cm50qF43bU1@mid.individual.net>
In reply to#1957
Hi Karl,

> maybe i'm "sensitive", but why "lie" again?

Unlike 'others' (read: Grafx) I do not have a problem to admit I was wrong.

Erik



"Karl Faller"  schreef in bericht 
news:tllb67pe93c8fgdp8md2eselfl3pmmonom@4ax.com...

Erik,


And just in case you would have tested as in:
FUNCTION Start()
LOCAL n, k AS DWORD
? n:=  GetTickCountLow()
Sleep(10000)
? k:= GetTickCountLow()
? k-n
WAIT
RETURN NIL

you could have noticed that the difference result is 100.000, not
10.0000..
I have no idea, if and how VO manages "tenths of milliseconds", but it
is clearly stated in the help:
Returns
The number of 1/10000 seconds (milliseconds/10) that have elapsed
since Windows was last started.


BTW, my Win32SDK shows the entry re 49,7 days below "GetTickCount",
NOT GetTickCountLow()
And, Vo provides a GetTickCount() as a GetTickCountLow(), the first
pointing to Kernel32 while the second points into the runtime, so it
may very well be different implemented...

So, for Dick, GetTickCount64 (function is limited to the resolution of
the system timer, which is typically in the range of 10 milliseconds
to 16milliseconds) might solve his problem, although an "non resetted
counter" based method might be prone to fail, at least on servers
after some 500 days...


Regards
Karl


>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.
><g>
>
>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 

[toc] | [prev] | [next] | [standalone]


#1954

From"Dirk (Belgium)" <dirk.dot.herijgers@pbprojects.dot.be>
Date2011-09-06 08:15 +0000
Message-ID<BEk9q.127$kj5.107@newsfe25.ams2>
In reply to#1940
Hi Dick (and all the other people)

If I read the initial message correct, the code is inside the dispatch
method.

If so, We could use the SetTimer(...) function and place a timer on
1400 ms. We also set a protect variable on True. After receiving the
WM_TIME message, we set the same protect variable on False.

Now, when a user pushes a key, you have just to see to the value of
this protect variable. When the value is True, then the 1400 ms is not
passed yet.

This solution has no DWORD-limit etc...

Dirk (Belgium)

D.J.W. van Kooten wrote:

> 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


-- 

[toc] | [prev] | [standalone]


Page 2 of 2 — ← Prev page 1 [2]

Back to top | Article view | comp.lang.clipper.visual-objects


csiph-web