ProfilerMarker
Constructs a new performance marker for code instrumentation.
Read time 3 minutesLast updated 5 days ago
Definition
- Type: Constructor
- Namespace: Unity.Profiling
- Assembly: UnityEngine.CoreModule
ProfilerMarker(string)
Constructs a new performance marker for code instrumentation.
public ProfilerMarker(string name)
Parameters
Marker name.
Remarks
Use ProfilerMarker to markup a piece of code for the Profiler and Recorder.
Examples
using Unity.Profiling;public class MySystemClass{ static readonly ProfilerMarker s_PreparePerfMarker = new ProfilerMarker("MySystem.Prepare"); static readonly ProfilerMarker s_SimulatePerfMarker = new ProfilerMarker(ProfilerCategory.Ai, "MySystem.Simulate"); public void UpdateLogic() { s_PreparePerfMarker.Begin(); // ... s_PreparePerfMarker.End(); using (s_SimulatePerfMarker.Auto()) { // ... } }}
ProfilerMarker(char*, int)
Constructs a new performance marker for code instrumentation.
public ProfilerMarker(char* name, int nameLen)
Parameters
Remarks
Use ProfilerMarker to markup a piece of code for the Profiler and Recorder.
Examples
using Unity.Profiling;public class MySystemClass{ static readonly ProfilerMarker s_PreparePerfMarker = new ProfilerMarker("MySystem.Prepare"); static readonly ProfilerMarker s_SimulatePerfMarker = new ProfilerMarker(ProfilerCategory.Ai, "MySystem.Simulate"); public void UpdateLogic() { s_PreparePerfMarker.Begin(); // ... s_PreparePerfMarker.End(); using (s_SimulatePerfMarker.Auto()) { // ... } }}
ProfilerMarker(ProfilerCategory, string)
Constructs a new performance marker for code instrumentation.
public ProfilerMarker(ProfilerCategory category, string name)
Parameters
Remarks
Use ProfilerMarker to markup a piece of code for the Profiler and Recorder.
Examples
using Unity.Profiling;public class MySystemClass{ static readonly ProfilerMarker s_PreparePerfMarker = new ProfilerMarker("MySystem.Prepare"); static readonly ProfilerMarker s_SimulatePerfMarker = new ProfilerMarker(ProfilerCategory.Ai, "MySystem.Simulate"); public void UpdateLogic() { s_PreparePerfMarker.Begin(); // ... s_PreparePerfMarker.End(); using (s_SimulatePerfMarker.Auto()) { // ... } }}
ProfilerMarker(ProfilerCategory, char*, int)
Constructs a new performance marker for code instrumentation.
public ProfilerMarker(ProfilerCategory category, char* name, int nameLen)
Parameters
Remarks
Use ProfilerMarker to markup a piece of code for the Profiler and Recorder.
Examples
using Unity.Profiling;public class MySystemClass{ static readonly ProfilerMarker s_PreparePerfMarker = new ProfilerMarker("MySystem.Prepare"); static readonly ProfilerMarker s_SimulatePerfMarker = new ProfilerMarker(ProfilerCategory.Ai, "MySystem.Simulate"); public void UpdateLogic() { s_PreparePerfMarker.Begin(); // ... s_PreparePerfMarker.End(); using (s_SimulatePerfMarker.Auto()) { // ... } }}
ProfilerMarker(string, MarkerFlags)
Constructs a new performance marker for code instrumentation.
public ProfilerMarker(string name, MarkerFlags flags)
Parameters
Remarks
Use ProfilerMarker to markup a piece of code for the Profiler and Recorder.
Examples
using Unity.Profiling;public class MySystemClass{ static readonly ProfilerMarker s_PreparePerfMarker = new ProfilerMarker("MySystem.Prepare"); static readonly ProfilerMarker s_SimulatePerfMarker = new ProfilerMarker(ProfilerCategory.Ai, "MySystem.Simulate"); public void UpdateLogic() { s_PreparePerfMarker.Begin(); // ... s_PreparePerfMarker.End(); using (s_SimulatePerfMarker.Auto()) { // ... } }}
ProfilerMarker(char*, int, MarkerFlags)
Constructs a new performance marker for code instrumentation.
public ProfilerMarker(char* name, int nameLen, MarkerFlags flags)
Parameters
Remarks
Use ProfilerMarker to markup a piece of code for the Profiler and Recorder.
Examples
using Unity.Profiling;public class MySystemClass{ static readonly ProfilerMarker s_PreparePerfMarker = new ProfilerMarker("MySystem.Prepare"); static readonly ProfilerMarker s_SimulatePerfMarker = new ProfilerMarker(ProfilerCategory.Ai, "MySystem.Simulate"); public void UpdateLogic() { s_PreparePerfMarker.Begin(); // ... s_PreparePerfMarker.End(); using (s_SimulatePerfMarker.Auto()) { // ... } }}
ProfilerMarker(ProfilerCategory, string, MarkerFlags)
Constructs a new performance marker for code instrumentation.
public ProfilerMarker(ProfilerCategory category, string name, MarkerFlags flags)
Parameters
Remarks
Use ProfilerMarker to markup a piece of code for the Profiler and Recorder.
Examples
using Unity.Profiling;public class MySystemClass{ static readonly ProfilerMarker s_PreparePerfMarker = new ProfilerMarker("MySystem.Prepare"); static readonly ProfilerMarker s_SimulatePerfMarker = new ProfilerMarker(ProfilerCategory.Ai, "MySystem.Simulate"); public void UpdateLogic() { s_PreparePerfMarker.Begin(); // ... s_PreparePerfMarker.End(); using (s_SimulatePerfMarker.Auto()) { // ... } }}
ProfilerMarker(ProfilerCategory, char*, int, MarkerFlags)
Constructs a new performance marker for code instrumentation.
public ProfilerMarker(ProfilerCategory category, char* name, int nameLen, MarkerFlags flags)
Parameters
Profiler category.
Marker name.
Marker name length.
The marker flags.
Remarks
Use ProfilerMarker to markup a piece of code for the Profiler and Recorder.
Examples
using Unity.Profiling;public class MySystemClass{ static readonly ProfilerMarker s_PreparePerfMarker = new ProfilerMarker("MySystem.Prepare"); static readonly ProfilerMarker s_SimulatePerfMarker = new ProfilerMarker(ProfilerCategory.Ai, "MySystem.Simulate"); public void UpdateLogic() { s_PreparePerfMarker.Begin(); // ... s_PreparePerfMarker.End(); using (s_SimulatePerfMarker.Auto()) { // ... } }}