:signOops:
After all that I found that the answer is even more simple.
Your counter for tenths of a second has 11 values (0 to 10) instead of 10
Therefore if you change If TimerTenSec < 10 to If TimerTenSec < 9 then the stopwatch wil be a lot more accurate.
However the method I suggested would ( I think) be still more accurate. I'll do some more timing test now.
LapTimer feature works perfectly. No need to reset any counters since Lap time is just a "snapshot" of current counters.
I wonder if it is possible to display the bottom bit of the table rather than the top bit without having to reverse sort it or remove the top entries.
I don't seem to be able to use TableLap.RowCount in a filter expression.
PS -the GetTickCount method is still losing 8 seconds each hour on my PPC but is exactly correct on the desktop. I WILL find those missing seconds (maybe this weekend).
PS -the GetTickCount method is still losing 8 seconds each hour on my PPC but is exactly correct on the desktop. I WILL find those missing seconds (maybe this weekend).
Hi Paulo,
BTW do you know of a method to display the bottom bit of a table rather than the top bit. I.E can you scroll the scrollbars under program control??
Nick
Sub ButtonLap_Click
LapNr = LapNr + 1
TableLap.AddRow(LapNr,TimerMin&":"&TimerSec&":"&TimerTenSec)
[COLOR="Red"]TableLap.TableSort("Time DESC")
TableLap.SelectCell("Lap",0)[/COLOR]
End Sub
Hi token,
Cableguy was right about cpu load affecting the counting method. Even hitting "Lap" can steal enough cpu cycles to cause a timer miss. If srb time or active sync are running in the background then the stopwatch really loses time rapidly. Also if the PPC goes to sleep then the stopwatch also stops.
The best way to solve all these problems is to caculate the values each time rather than incrementing them. The resulting code is very simple and results in an extremely accurate stopwatch whch is just about indestructable.
Even the PPC goin to sleep doesn;t stop it displaying the right time once it awakes and if active sync is running, the stopwatch may appear to run roughly but it is still keeping exact time.
I also found a way to display the bottom bit of a table. You just access the bottom left cell of the table and then move focus to a button hidden under the lap button. This work perfectly on the desktop but causes an exception on the PPC when LAP is pushed - I'm not sure why yet.
I've attached the new sample code (with the focus thing commented out).
I think that the only way you can slow this stopwatch down is to drop it in a bucket of water .
The best way to solve all these problems is to caculate the values each time rather than incrementing them. The resulting code is very simple and results in an extremely accurate stopwatch whch is just about indestructable.
.