I’m making a lap timer at the moment, and I realised just how awful the Timer class is.
I’ve observed it’s lack of accuracy before, but only now do I realise what a joke this class is.
Making a stopwatch type class should be a fairly obvious and basic use of the Timer class and yet it’s impossible if you want anything more than a 10th of a second accuracy.
I want 100th of a second, and for this the Timer class is no good.
It even says in the AS3 reference that you shouldn’t use less than a 20ms interval because the timer can’t fire more than 60 times a second. Incidentally, assigning it 16.67 doesn’t keep a steady 60fps either.
For this reason it’s also useless for governing a fixed timestep (for example a 100hz physics update and 60hz graphics update).
So anyway, enough ranting, what is your replacement for an accurate timer? The only thing I can think of is simply using getTimer() with a time offset. You can measure laptimes accurately and reset etc just by subtracting the relevant time offsets.