Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/ProwlEngine/Prowl/llms.txt

Use this file to discover all available pages before exploring further.

Prowl’s Time class provides every timing value a game or engine subsystem could need. It is a thin static façade over a stack of TimeData objects — Time.TimeStack — allowing different engine contexts (e.g., editor playmode vs. a paused-game sub-simulation) to maintain their own independent clocks by pushing and popping TimeData instances. In normal gameplay only one TimeData lives on the stack: the main game clock, which is updated once per frame by the engine loop. All properties delegate directly to Time.CurrentTime, the topmost entry on the stack.

TimeData Stack

TimeStack
Stack<TimeData>
The full stack of active time contexts. Push a new TimeData instance to begin an independent timing context; pop it to return to the previous one.
CurrentTime
TimeData
Returns TimeStack.Peek() — the active timing context. All static Time.* properties read from this object.

Frame Delta

deltaTime

public static double deltaTime
Time in seconds since the last frame, scaled by timeScale. Use this for most gameplay movement and physics code.
transform.position += velocity * Time.deltaTime;

deltaTimeF

public static float deltaTimeF
(float)deltaTime — a single-precision convenience property for APIs that require float.

unscaledDeltaTime

public static double unscaledDeltaTime
Time in seconds since the last frame, not affected by timeScale. Use this for UI animations, timers, or anything that should continue running when the game is paused (timeScale = 0).

Accumulated Time

time

public static double time
Total scaled time elapsed since the engine started (or since the current TimeData was reset). Equivalent to the sum of all deltaTime values.

unscaledTotalTime

public static double unscaledTotalTime
Total unscaled time elapsed. Not affected by timeScale.

Fixed Timestep

fixedDeltaTime

public static double fixedDeltaTime
The physics fixed-timestep interval in seconds: 1.0 / PhysicsSetting.Instance.TargetFrameRate. This property reads PhysicsSetting directly; it does not vary frame-to-frame. The default TargetFrameRate is 50, yielding fixedDeltaTime ≈ 0.02.
fixedDeltaTime is not stored in TimeData. It is derived from PhysicsSetting each time it is accessed.

Frame Count

frameCount

public static long frameCount
The total number of frames rendered since the current TimeData was created. Incremented by one at the start of each TimeData.Update() call.

Time Scale

timeScale

public static double timeScale { get; set; }
Multiplier applied to raw delta time. Default: 1.0. Set to 0 to pause the game; set to 2 for slow-motion in reverse. Does not affect unscaledDeltaTime or unscaledTotalTime.

timeScaleF

public static float timeScaleF { get; set; }
Single-precision version of timeScale. Getting returns (float)timeScale; setting assigns to timeScale.
// Pause the game
Time.timeScale = 0.0;

// Slow-motion
Time.timeScale = 0.25;

// Restore normal speed
Time.timeScale = 1.0;

Smoothed Delta

smoothDeltaTime

public static double smoothDeltaTime
An exponential moving average of deltaTime. Useful for displaying frame rate or for physics/animation that should ignore single-frame spikes. Computed as:
smoothUnscaledDeltaTime = smoothUnscaledDeltaTime + (dt - smoothUnscaledDeltaTime) * timeSmoothFactor
smoothDeltaTime         = smoothUnscaledDeltaTime * dt

smoothUnscaledDeltaTime

public static double smoothUnscaledDeltaTime
The smoothed unscaled delta. The intermediate EMA before the scale factor is applied to produce smoothDeltaTime.

timeSmoothFactor

public static double timeSmoothFactor { get; set; }
Blend factor for the EMA. Range (0, 1]. Default: 0.25. Higher values react faster to frame-rate changes; lower values produce a more stable smooth average.

TimeData Class

TimeData is the mutable, per-context timing record updated by the engine loop.
public class TimeData
{
    public double unscaledDeltaTime;
    public double unscaledTotalTime;
    public double deltaTime;
    public double time;
    public double smoothUnscaledDeltaTime;
    public double smoothDeltaTime;

    public long   frameCount;
    public double timeScale         = 1.0;
    public float  timeScaleF        => (float)timeScale;
    public double timeSmoothFactor  = 0.25;

    public void Update();
}
Update() reads from an internal Stopwatch, increments frameCount, applies timeScale, and recalculates the EMA. It is called once per engine frame tick.

Reference Summary

PropertyTypeScaled?Description
deltaTimedoubleSeconds since last frame
deltaTimeFfloatfloat cast of deltaTime
unscaledDeltaTimedoubleRaw seconds since last frame
timedoubleTotal elapsed time
unscaledTotalTimedoubleTotal unscaled elapsed time
fixedDeltaTimedouble1 / TargetFrameRate (physics step)
frameCountlongFrames since context start
timeScaledoublePlayback speed multiplier
smoothDeltaTimedoubleEMA-smoothed delta time
smoothUnscaledDeltaTimedoubleEMA-smoothed unscaled delta
timeSmoothFactordoubleEMA blend coefficient

Usage Examples

// Frame-rate independent movement
transform.position += forward * speed * (float)Time.deltaTime;

Build docs developers (and LLMs) love