Table of Contents

Class Timings

Namespace
ValveResourceFormat.Renderer
Assembly
Renderer.dll

Utility class for measuring CPU and GPU timings of code regions.

public class Timings

Inheritance

Inherited Members

Constructors

Timings()

public Timings()

Properties

Capture

public bool Capture { get; set; }

Property Value

bool

Methods

BeginQuery(string)

Begins a new timing measurement for the specified name.

public int BeginQuery(string name)

Parameters

name string

Name of the region to time.

Returns

int

Query ID to use when ending the query, or 0 if timing is disabled.

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()

EndQuery(int)

Ends a timing measurement.

public void EndQuery(int id)

Parameters

id int

Query ID returned from BeginQuery.

MarkFrameBegin()

public void MarkFrameBegin()

MarkFrameEnd()

Clears all collected timing results and transfers ownership to the calling thread.

public void MarkFrameEnd()