[wxPython-users] wx.Timer accurate?
Christopher Barker
Chris.Barker at noaa.gov
Tue Jul 25 09:33:18 PDT 2006
John Salerno wrote:
> I'm beginning to wonder if it keeps accurate time (on
> WinXP).
> For now, I'm just wondering if Timer is the proper
> class to use, and if it's really as accurate as it should be for
> making a timing program.
wxTimer is not intended to be used this way. It is only approximate. It
gets integrated with the event loop, and can be off by a fair bit,
depending on how long it takes to process other events.
What you can do is use a wxTimer to get event approximately when you
want them, and then, when handling that event check the system clock to
see how much time has really passed. For an example, see the AnalogClock
code in the demo.
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chris.Barker at noaa.gov
More information about the wxpython-users
mailing list