PerformanceMonitor Class

Monitors game performance metrics like FPS, frame time, and memory usage. Provides data for performance overlays and profiling.

public class PerformanceMonitor

Inheritance System.Object → PerformanceMonitor

Properties
AverageFPS Gets the average FPS.
BatchCount Gets the number of batches used.
BatchEfficiency Gets the batch efficiency (sprites per batch).
CulledSprites Gets the number of sprites culled (not rendered).
CurrentFPS Gets the current frames per second.
CurrentFrameTime Gets the current frame time in milliseconds.
DrawCalls Gets the number of draw calls in the last frame.
EntityCount Gets the total number of entities.
FrameTimeHistory Gets the frame time history for the last 60 frames.
Gen0Collections Gets the number of Gen 0 garbage collections.
Gen1Collections Gets the number of Gen 1 garbage collections.
Gen2Collections Gets the number of Gen 2 garbage collections.
MaxFPS Gets the maximum FPS recorded.
MaxFrameTime Gets the maximum frame time in milliseconds.
MinFPS Gets the minimum FPS recorded.
MinFrameTime Gets the minimum frame time in milliseconds.
SpriteCount Gets the number of sprites rendered.
TotalMemoryMB Gets the total managed memory in megabytes.
Methods
BeginFrame() Begins timing a new frame.
EndFrame() Ends frame timing and updates statistics.
Reset() Resets all statistics (useful for benchmarking).
UpdateRenderStats(int, int, int, int, int) Updates rendering statistics for the current frame.