Auto()
Creates a helper struct for the scoped using blocks.
Read time 1 minuteLast updated 10 days ago
Definition
- Type: Method
- Namespace: Unity.Profiling
- Assembly: UnityEngine.CoreModule
public ProfilerMarker.AutoScope Auto()
Returns
Type | Description |
|---|---|
| AutoScope | IDisposable 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()) { // ... } }}