Class Timings
Namespace: ValveResourceFormat.Renderer
Assembly: Renderer.dll
Utility class for measuring CPU and GPU timings of code regions.
public class TimingsInheritance
Properties
Capture
Gets or sets whether timing data is actively collected this frame.
public bool Capture { get; set; }Property Value
Methods
DisplayTimings(TextRenderer, Camera, float, float, float)
Renders timing results to screen using the provided text renderer.
public void DisplayTimings(TextRenderer textRenderer, Camera camera, float x = 0.02, float y = 0.05, float scale = 11)Parameters
textRenderer TextRenderer
Text renderer to use for display.
camera Camera
Camera for positioning text.
x float
X position (0-1 as fraction of screen width).
y float
Y position (0-1 as fraction of screen height).
scale float
Text scale.
Dispose()
Releases resources.
public void Dispose()SetAsyncRow(string, double?, string)
Records work measured off the frame - another thread, or a window that is not a frame - listed under an "Async" header below the frame's own rows. Replaced by name on each call, so the caller just sets it every frame from whatever the producing thread last published.
public void SetAsyncRow(string name, double? cpuMs, string detail = "")Parameters
name string
Row label, unique per source.
cpuMs double?
CPU milliseconds to show, or null to leave the column blank for a row that is not a duration.
detail string
Free-form right-hand column, e.g. a duty cycle or a byte count.
SetBufferSwapTime(double, double)
Records the swap wait and the frame period it belongs to, and folds them into the unaccounted remainder. Uses the total snapshotted rather than the live results, which are cleared by then, and which the display only ever sees part of anyway.
public void SetBufferSwapTime(double milliseconds, double framePeriodMilliseconds)Parameters
milliseconds double
Wall time the swap call blocked for.
framePeriodMilliseconds double
Wall time between this swap and the last, or 0 for a frame that should not be sampled at all, such as a paused one.

