Skip to content

KernelAPI reference

Struct FrameStatistics

Namespace: MicroEngine.Core
Assembly: MicroEngine.dll
Guide: Game lifecycle and time

What a frame cost, as LastFrame reports it. Times are in milliseconds of real time.

C#
public readonly struct FrameStatistics : IEquatable<FrameStatistics>

Implements

IEquatable<FrameStatistics>

Constructors

FrameStatistics(long, double, double, double, double, double, int, long, int, int, int, GraphicsCounters, AudioStatistics)

What a frame cost, as LastFrame reports it. Times are in milliseconds of real time.

C#
public FrameStatistics(long Frame, double Interval, double Events, double Update, double Render, double Present, int Steps, long Allocated, int Gen0Collections, int Gen1Collections, int Gen2Collections, GraphicsCounters Graphics, AudioStatistics Audio)

Parameters

Frame long

The number of the frame, from 1; 0 when nothing was measured.

Interval double

Time since the previous measured frame started (0 for the first one).

Events double

The platform’s event pump.

Update double

The fixed steps and the per-frame updates (BeginFrame to LateUpdate).

Render double

Extracting and drawing (Extract and Render).

Present double

Presenting (Present and EndFrame), which includes waiting for the display.

Steps int

Fixed steps the frame ran.

Allocated long

Bytes the game’s thread allocated during the frame.

Gen0Collections int

Garbage collections of generation 0 during the frame.

Gen1Collections int

Garbage collections of generation 1 during the frame.

Gen2Collections int

Full garbage collections during the frame.

Graphics GraphicsCounters

The work the frame submitted to the graphics device (draw calls, passes, uploads; LiveResources is the count at its end). Zeros on a platform whose device does not count.

Audio AudioStatistics

The mixer’s voices at the end of the frame.

Properties

Allocated

Bytes the game’s thread allocated during the frame.

C#
public long Allocated { get; init; }

Property Value

long

Audio

The mixer’s voices at the end of the frame.

C#
public AudioStatistics Audio { get; init; }

Property Value

AudioStatistics

Collections

Garbage collections of any generation during the frame.

C#
public int Collections { get; }

Property Value

int

Events

The platform’s event pump.

C#
public double Events { get; init; }

Property Value

double

Frame

The number of the frame, from 1; 0 when nothing was measured.

C#
public long Frame { get; init; }

Property Value

long

Gen0Collections

Garbage collections of generation 0 during the frame.

C#
public int Gen0Collections { get; init; }

Property Value

int

Gen1Collections

Garbage collections of generation 1 during the frame.

C#
public int Gen1Collections { get; init; }

Property Value

int

Gen2Collections

Full garbage collections during the frame.

C#
public int Gen2Collections { get; init; }

Property Value

int

Graphics

The work the frame submitted to the graphics device (draw calls, passes, uploads; LiveResources is the count at its end). Zeros on a platform whose device does not count.

C#
public GraphicsCounters Graphics { get; init; }

Property Value

GraphicsCounters

Interval

Time since the previous measured frame started (0 for the first one).

C#
public double Interval { get; init; }

Property Value

double

Present

Presenting (Present and EndFrame), which includes waiting for the display.

C#
public double Present { get; init; }

Property Value

double

Render

Extracting and drawing (Extract and Render).

C#
public double Render { get; init; }

Property Value

double

Steps

Fixed steps the frame ran.

C#
public int Steps { get; init; }

Property Value

int

Total

The frame’s work: events, update, render and present.

C#
public double Total { get; }

Property Value

double

Update

The fixed steps and the per-frame updates (BeginFrame to LateUpdate).

C#
public double Update { get; init; }

Property Value

double

Methods

Deconstruct(out long, out double, out double, out double, out double, out double, out int, out long, out int, out int, out int, out GraphicsCounters, out AudioStatistics)

C#
public void Deconstruct(out long Frame, out double Interval, out double Events, out double Update, out double Render, out double Present, out int Steps, out long Allocated, out int Gen0Collections, out int Gen1Collections, out int Gen2Collections, out GraphicsCounters Graphics, out AudioStatistics Audio)

Parameters

Frame long

Interval double

Events double

Update double

Render double

Present double

Steps int

Allocated long

Gen0Collections int

Gen1Collections int

Gen2Collections int

Graphics GraphicsCounters

Audio AudioStatistics

Equals(object)

C#
public override bool Equals(object obj)

Parameters

obj object

Returns

bool

Equals(FrameStatistics)

C#
public bool Equals(FrameStatistics other)

Parameters

other FrameStatistics

Returns

bool

GetHashCode()

C#
public override int GetHashCode()

Returns

int

ToString()

C#
public override string ToString()

Returns

string

Operators

operator ==(FrameStatistics, FrameStatistics)

C#
public static bool operator ==(FrameStatistics left, FrameStatistics right)

Parameters

left FrameStatistics

right FrameStatistics

Returns

bool

operator !=(FrameStatistics, FrameStatistics)

C#
public static bool operator !=(FrameStatistics left, FrameStatistics right)

Parameters

left FrameStatistics

right FrameStatistics

Returns

bool