-
My question is related to the timers interval, what is the exact interval for 1 second, 1000 comes pretty close but it loose apporximately a second every 3 to 4 minutes, and I need it to be really exact, is there an interval that is exactly 1 second?
-
I noticed this a while back - timers aren't particularly accurate - in fact if you drag a window around the screen continuously a timer event won't occur until you drop it (at least in 16-bit VB4 it didn't - I don't know about now!)
What I would do is set a timer event to happen every 100th of a second (Timer.Interval=10) and do something like this;
Dim LastTime as Date
LastTime=Now
Sub Timer1.Timer
If DateDiff("s",LastTime,Now)>=1 Then
[do what you need to do each second]
LastTime=Now
Endif
End Sub
I haven't tested this code so I don't know if it works - basically every 100th of a second it checks to see if it's a second later than it looked last time
Hope this helps.