VB6 Timer Object not working as expected
Posted on 2007-08-01
guaranteed to Stump the expert.
I am using the timer object in VB6. Along with that I am using the GetTickCount api. I call the GetTickCount at the beginning of the timer routine and display the returned value, we'll call it INTERVAL. I call it again at the end of the routine and display the delta from the first call (the elapsed time of the routine called ELAPSED). I set the timer interval so that it is larger than the elapsed time of the routine. When I run this code the INTERVAL is always the sum of ELAPSED and the timer interval. This implies that the timer object restarts itself after every execution of the timer routine. I don't know exactly how the timer object works, but this result was HIGHLY unexpected. What I expected was that as long as ELPASED was less than the timer interval then INTERVAL would be very close to the timer interval. But that is not the case. Can you explain this? Is this a bug? Or is this "By Design"?