struct in Unity.Profiling
/
Implemented in:UnityEngine.CoreModule
Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.
CloseFor some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.
CloseHelper IDisposable struct for use with ProfilerMarker.Auto.
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.
using Unity.Profiling;
public class MySystemClass { ProfilerMarker simulatePerfMarker = new ProfilerMarker("MySystem.Simulate");
public void UpdateLogic() { using (simulatePerfMarker.Auto()) { // ... } } }