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

@:value(0.0)staticdelta:Float = 0.0

Scaled delta time of the last frame in seconds.

This value already includes scale.

@:value(0.0)staticrealTime:Float = 0.0

Real elapsed application time in seconds.

Unlike time, this value is not affected by scale.

@:value(new s.shortcut.signals.Signal([]))staticread onlyrealTimeChanged:Signal<(realTime:Float) ‑> Void> = new s.shortcut.signals.Signal([])

@:value(1.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.

@:value(0.0)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.

@:value(new s.shortcut.signals.Signal([]))staticread onlytimeChanged:Signal<(time:Float) ‑> Void> = new s.shortcut.signals.Signal([])

Static methods

staticmeasure(f:() ‑> Void):Float

Measures how long a function takes in real time.

This uses realTime, so the result is not affected by scale.

Parameters:

f

Function to execute.

Returns:

Duration in seconds.

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.

staticoffRealTimeChanged(slot:(realTime:Float) ‑> Void):Bool

staticoffTimeChanged(slot:(time:Float) ‑> Void):Bool

staticonRealTimeChanged(slot:(realTime:Float) ‑> Void):(realTime:Float) ‑> Void

staticonTimeChanged(slot:(time:Float) ‑> Void):(time:Float) ‑> Void