ProfilerMarker.AutoScope
Helper IDisposable struct for use with ProfilerMarker.Auto.
Read time 1 minuteLast updated 10 days ago
Definition
- Type: Struct
- Namespace: Unity.Profiling
- Assembly: UnityEngine.CoreModule
- Implements: IDisposable
public struct ProfilerMarker.AutoScope : IDisposable
Remarks
Use ProfilerMarker.Auto to enclose a piece of code you want to profile in using statement. Constructor of AutoScope calls ProfilerMarker.Begin and Dispose method - ProfilerMarker.Begin.
Examples
using Unity.Profiling;public class MySystemClass{ ProfilerMarker simulatePerfMarker = new ProfilerMarker("MySystem.Simulate"); public void UpdateLogic() { using (simulatePerfMarker.Auto()) { // ... } }}