Class Timings
Namespace: ValveResourceFormat.Renderer
Assembly: Renderer.dll
Utility class for measuring CPU and GPU timings of code regions.
public class TimingsInheritance
Constructors
Timings()
Initializes a new instance owned by the current thread.
public Timings()Properties
Capture
Gets or sets whether timing data is actively collected this frame.
public bool Capture { get; set; }Property Value
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
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()
Resets the query index and assigns timing ownership to the calling thread for the new frame.
public void MarkFrameBegin()MarkFrameEnd()
Clears all collected timing results and transfers ownership to the calling thread.
public void MarkFrameEnd()
