Timer

loreline.Timer (Class)

Deferred timer system for non-blocking wait() on game-loop targets.

On sys targets, deferredMode starts false. Once the host calls update() (or enableDeferredMode() directly), deferred mode is active and wait() will register timers here instead of blocking with Sys.sleep().

For CLI/tool targets that never call update(), wait() falls back to the blocking Sys.sleep() path automatically.

Static Members

register(seconds: Float, done: Function): Void

Register a timer to fire done after seconds have elapsed. Called by wait() when deferred mode is active.

Name Type
seconds Float
done Function

update(delta: Float): Void

Tick all pending timers by delta seconds, firing any that have expired. Call this every frame from your game loop. The first call also enables deferred mode on sys targets.

Name Type Description
delta Float Time elapsed since the last frame in seconds.

Private Members