Version: 2020.2
言語: 日本語

AutoScope

struct in Unity.Profiling

マニュアルに切り替える

説明

Helper 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 { static ProfilerMarker s_SimulatePerfMarker = new ProfilerMarker("MySystem.Simulate");

public void UpdateLogic() { using (s_SimulatePerfMarker.Auto()) { // ... } } }