Guidance Forums / Rapid-Q Basic / Problem with QTimer

Search 搜索
Home Home

Forum List • Thread List • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. Problem with QTimer
Posted by: cajino 2003-05-28 05:44:29
I'm trying to make a program to measure time quite accurately (it's a chronometer for byke racing).
I noticed that setting the interval at 10 my chronometer fails by several seconds per minute, while setting it at 100 thing go a little better, but even with an interval of 1000 I get a 2 soc/min error!
I tried with VB6 and had the same problem.
Now, has my computer gone nuts or is this a common problem?(it's an AMD 1.7G 512 Mb).
Thank you all

Message2. Re: Problem with QTimer
Posted by: guidance 2003-05-28 07:13:22
I suppose QTimer implemented in Windows is still using native basic timer, i.e. 18.2Hz, i.e. 55mS resolution. I suggest don't rely on this as a real world stop-watch, you can read machine clock / timestamp in ontimer event handler, rather than accumulate the qtimer ticks itself. Here's a high resolution timestamp:
Message3. Re: Problem with QTimer
Posted by: cajino 2003-05-30 14:29:10
Exactly what I needed, thanks Guidance.

Forum List • Thread List • Refresh • New Topic • Search • Previous • Next First 1 Last
© Sun 2022-1-16  Guidance Laboratory Inc. Hits:0