Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


Auto()

Creates a helper struct for the scoped using blocks.
Read time 1 minuteLast updated 10 days ago

Definition

public ProfilerMarker.AutoScope Auto()

Returns

Type

Description

AutoScopeIDisposable struct which calls ProfilerMarker.Begin and ProfilerMarker.End automatically.

Remarks

ProfilerMarker.Begin is called in the constructor and ProfilerMarker.End in the Dispose method.
Note: ProfilerMarker.Auto is thread safe and can be used in jobified code.

Examples

using Unity.Profiling;public class MySystemClass{ static ProfilerMarker s_SimulatePerfMarker = new ProfilerMarker("MySystem.Simulate"); public void UpdateLogic() { using (s_SimulatePerfMarker.Auto()) { // ... } }}