Global scaled and unscaled time values updated once per frame.
Time is the engine-wide clock service. It tracks both:
- real time, which follows the platform clock
- scaled time, which advances by delta * scale
This separation is useful for pausing or slowing gameplay while still being able to measure real elapsed time for diagnostics or platform-facing tasks.
Static variables
staticdelta:Float = 0.0
Scaled delta time of the last frame in seconds.
This value already includes scale.
staticrealTime:Float = 0.0
staticscale:Float = 1.0
Multiplier applied to realtime delta when advancing time.
Set this to 0 to freeze scaled time, or below 1 to slow it down.
statictime:Float = 0.0
Scaled application time in seconds.
Timers and time listeners in the engine generally use this clock unless they explicitly opt into real time.
Static methods
staticmeasure(f:() ‑> Void):Float
staticnotifyOnRealTime(callback:() ‑> Void, time:Float):{time:Float, f:() ‑> Void}
Registers a callback to be called when real time reaches a target timestamp.
This is useful for timeouts that should keep progressing even if scaled time is paused or slowed down.
Parameters:
callback | Function to call. |
|---|---|
time | Trigger timestamp in real seconds. |
Returns:
The created listener record.
staticnotifyOnTime(callback:() ‑> Void, time:Float):{time:Float, f:() ‑> Void}
Registers a callback to be called when scaled time reaches a target timestamp.
The callback is invoked once and then removed automatically.
Parameters:
callback | Function to call. |
|---|---|
time | Trigger timestamp in scaled seconds. |
Returns:
The created listener record.