Table of Contents

Class GameTime

Namespace
Microsoft.Xna.Framework
Assembly
MonoGame.Framework.dll

Holds the time state of a Game.

public class GameTime
Inheritance
GameTime
Inherited Members

Constructors

GameTime()

Create a GameTime instance with a TotalGameTime and ElapsedGameTime of

0
.
public GameTime()

GameTime(TimeSpan, TimeSpan)

Create a GameTime with the specified TotalGameTime and ElapsedGameTime.

public GameTime(TimeSpan totalGameTime, TimeSpan elapsedGameTime)

Parameters

totalGameTime TimeSpan

The total game time elapsed since the start of the Game.

elapsedGameTime TimeSpan

The time elapsed since the last call to Update(GameTime).

GameTime(TimeSpan, TimeSpan, bool)

Create a GameTime with the specified TotalGameTime and ElapsedGameTime.

public GameTime(TimeSpan totalRealTime, TimeSpan elapsedRealTime, bool isRunningSlowly)

Parameters

totalRealTime TimeSpan

The total game time elapsed since the start of the Game.

elapsedRealTime TimeSpan

The time elapsed since the last call to Update(GameTime).

isRunningSlowly bool

A value indicating if the Game is running slowly.

Properties

ElapsedGameTime

Time since the last call to Update(GameTime).

public TimeSpan ElapsedGameTime { get; set; }

Property Value

TimeSpan

IsRunningSlowly

Indicates whether the Game is running slowly.

This flag is set to true when IsFixedTimeStep is set to true and a tick of the game loop takes longer than TargetElapsedTime for a few frames in a row.

public bool IsRunningSlowly { get; set; }

Property Value

bool

TotalGameTime

Time since the start of the Game.

public TimeSpan TotalGameTime { get; set; }

Property Value

TimeSpan