A cancellable handle returned by Thread.setTimeout, Thread.setInterval and Thread.everyFrame.

Cancellation is cooperative: the underlying coroutine checks active each time it wakes up, so a cancelled interval stops before its next run rather than being killed mid-body.

Variables

@:value(true)read onlyactive:Bool = true

False once cancel() has been called, or once a timeout has fired.

Methods

cancel():Void

Stops the timer. Safe to call repeatedly, and safe to call from inside the timer's own body.