Class Timer

A Timer that, when running, repeatedly ticks at a specific interval.

class Timer ;

Constructors

NameDescription
this (interval, autostart) Instantiate a Timer that repeatedly ticks at every given interval.

Fields

NameTypeDescription
onTick Event!(teraflop.time.Timer)Occurs when an interval amount of time has passed since the last tick event.

Properties

NameTypeDescription
duration[get] core.time.DurationDuration that this timer has been running.
durationSeconds[get] longDuration that this timer has been running, in seconds.
justTicked[get] boolWhether this timer just ticked.
running[get] boolWhether or not this timer is ticking.

Methods

NameDescription
start () Start this timer.
stop () Stop this timer.
update () Update this timer, resetting justTicked to false if neccesary since the last update.