Skip to content

GameTime Struct

Definition

Namespace: Brine2D.Core

Represents timing information for the game loop.

C#
public readonly record struct GameTime : System.IEquatable<Brine2D.Core.GameTime>

Implements System.IEquatable<GameTime>

Constructors
GameTime\(TimeSpan, TimeSpan, long, bool, float\) Represents timing information for the game loop.
Properties
Alpha Physics interpolation factor in the range [0, 1]. Only meaningful during the render pass. Represents how far the current frame is between the last two fixed timesteps: 0 = exactly at the last fixed step, 1 = exactly at the next step. Use this to lerp rendered positions between the previous and current physics state for smooth visuals at any frame rate. Always 0 during Update and FixedUpdate.
DeltaTime Gets the elapsed time as seconds \(convenience property\).
ElapsedTime The elapsed time since the last frame.
FrameCount The total number of frames rendered since the game started.
IsTimeClamped Whether ElapsedTime was clamped this frame. True when the raw delta exceeded MaxDeltaTime \(e\.g\., after a debugger pause\). Systems that synchronize with wall-clock time \(audio, animation\) can use this to skip resynchronization rather than jumping forward.
TotalSeconds Gets the total time as seconds \(convenience property\).
TotalTime The total elapsed time since the game started.