Ticks, 1000000 in a second?


Active Member
Licensed User
I wrote a stopwatch program using Ticks.
The help file says there is a million ticks in a second, but the counter/1000000 goes up by 10 a second???


Licensed User
Longtime User
Yes - I've come across this when benchmarking my Cray1 maths library. Although there ARE 10,000,000 (not 1,000,000) "ticks" in a second they are not real ticks. On my desktop "now" ticks about every 15.6ms (about 60hz - wonder why ;))and on my device only once per second. Each real tick adds enough virtual ticks to the tick counter to keep it in step with real time.

You can see this with something like

Then = now
Next = now
Loop Until Next <> Then
msgbox(Next - Then)

Because of this, especially on the device, things that need time comparisons should ensure that they have enough "real" ticks to give a meaningful result with the precision required.


Active Member
Licensed User
so Helpfile wrong

ok if it is 10,000,000 ticks in a sec its just a typo in the helpfile not a bug in Basic4ppc