From: Jacques St-Pierre on 13 Apr 2010 10:37 Hello, Do anyone know a way to obtain an RTC (Real Time Clock) Event each second in VB6? Do not tell me to use a Timer, it's what I do now, but those timers are not precise enough to keep time. So I wish to find a way to use the PC RTC instead to generate a event each second. Bye Jacques
From: Jim Mack on 13 Apr 2010 12:04 Jacques St-Pierre wrote: > Hello, > > Do anyone know a way to obtain an RTC (Real Time Clock) Event each > second in VB6? > > Do not tell me to use a Timer, it's what I do now, but those timers > are not precise enough to keep time. So I wish to find a way to use > the PC RTC instead to generate a event each second. Not natively. There may be device drivers that could help you implement something like that, but I've never seen one. There are at least two issues with timing under VB6. The VB Timer has a fairly poor granularity. Depending on the system timer interval it may not tick an even number of times per second, so a pure accumulation of ticks will drift. Also, in Windows generally timer events have a low priority, and any event that is missed is lost -- they do not stack up in the message queue. Still, you can get pretty good timekeeping on average if you use a VB Timer of, say, 100 mSec and in the _Timer event check the system time for 1-second rollovers. For more precise timing, use a Multimedia timer. There are third-party controls built around the MM timer, like the CCRP High-Precision Timer (check www.mvps.org). But none of these will access the BIOS RTC. -- Jim Mack Twisted tees at http://www.cafepress.com/2050inc "We sew confusion"
|
Pages: 1 Prev: Writing a class onto a binary file with VB .NET Next: using square bracket. |