Table of Contents

Class PerformanceElement

Namespace
SharpConsoleUI.Panel
Assembly
SharpConsoleUI.dll

A panel element that displays performance metrics (FPS and dirty characters). Uses a timer to invalidate periodically rather than every frame.

public class PerformanceElement : PanelElement, IPanelElement, IDisposable
Inheritance
PerformanceElement
Implements
Inherited Members
Extension Methods

Constructors

PerformanceElement(string?)

Initializes a new PerformanceElement.

public PerformanceElement(string? name = null)

Parameters

name string

Optional element name. Defaults to "performance".

Properties

FixedWidth

Gets the fixed width of this element, or null if it uses MeasureWidth() or flex sizing.

public override int? FixedWidth { get; }

Property Value

int?

ShowDirtyChars

Gets or sets whether to show dirty character count.

public bool ShowDirtyChars { get; set; }

Property Value

bool

ShowFPS

Gets or sets whether to show FPS metric.

public bool ShowFPS { get; set; }

Property Value

bool

UpdateIntervalMs

Gets or sets the update interval in milliseconds.

public int UpdateIntervalMs { get; set; }

Property Value

int

Methods

Dispose()

Disposes the timer resource.

public void Dispose()

Render(CharacterBuffer, int, int, int, Color, Color)

Renders the element into the character buffer at the specified position.

public override void Render(CharacterBuffer buffer, int x, int y, int width, Color fg, Color bg)

Parameters

buffer CharacterBuffer

The character buffer to render into.

x int

The x position to render at.

y int

The y position to render at.

width int

The allocated width for this element.

fg Color

The default foreground color.

bg Color

The default background color.