# Accurate timers, how do you do yours?

**URL:** <https://forum.kirupa.com/t/accurate-timers-how-do-you-do-yours/320451>\
**Category:** flash\
**Created:** [March 23, 2011, 10:36pm UTC](https://forum.kirupa.com/t/accurate-timers-how-do-you-do-yours/320451 "2011-03-23T22:36:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rumblesushi](https://avatars.discourse-cdn.com/v4/letter/r/b38774/32.png) [@rumblesushi](https://forum.kirupa.com/u/rumblesushi)\
**Post date:** [March 23, 2011, 10:36pm UTC](https://forum.kirupa.com/t/accurate-timers-how-do-you-do-yours/320451/1 "2011-03-23T22:36:25Z")

</div>

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.
