realbasic-nug
[Top] [All Lists]

Re: Timers (probably revisited)

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: Timers (probably revisited)
From: "Joseph J. Strout" <joe at realsoftware dot com>
Date: Wed, 31 Aug 2005 16:34:13 -0600
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <EC5FDC70-AA3F-4043-917E-4C059AADCA5A at yadtel dot net> <a06200733bf3bd50d48fd at [10 dot 0 dot 1 dot 4]> <5468328E-571A-40BB-9C94-952CE1EBAAC5 at yadtel dot net>
At 6:07 PM -0400 8/31/05, Richard wrote:

Does this mean that any and all events can only occur every 16msec?

Generally so, yes.

Say, if I have serial data available just after a system tick, then I won't get a DataAvail event until the next tick?

Quite likely, though the details are implementation-dependent and undocumented.

Thanks for that info Joe. But how do I measure the time since the last frame if the Microseconds count (on Windows) has a resolution of 16000 microseconds?

Are you sure about that? I thought your results indicated that the timer was firing at 16 or 32 msec intervals, not that the measurements had that resolution.

But even if that's the case, it should be good enough -- you only need to measure whether the timer has fired 16 msec since the last time, or 32.

In my app it looks like the proper update period is going to be (well, should be) about half way between 16mSec and 32Msec, cause a 16mSec period is too fast and 32mSec is too slow. I suppose I can live with either one or the other, but do I have to?

No, you should adjust your code so that BOTH frame rates are just fine, as well as other frame rates (such as 48 msec, though much beyond that may start to cause noticeable jerkiness).

Best,
- Joe

--
Joe Strout                          REAL Software, Inc.

Vote for REALbasic (twice!) in the LinuxWorld Reader's Choice Awards:
http://linux.sys-con.com/general/readerschoice.htm
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>