Timer Class

This class is designed for in game timers. The time is based on milliseconds, and so works in real time.

With this you can get the percentage complete, a value from 0.0 to 1.0, which allows you to animate graphics over time. They are also re-usable, with you being able to reset or invert a time on the fly.

You create a new Timer, giving it a duration which it will last for. You can then check if it has passed the duration by calling 'isExpired'.

new

clone

invert

reset

onExpire

cancelExpires

getDuration

getDurationLeft

getElapsed

getExpireTime

getPercent

getPercentLeft

isExpired