Struct ProfilerScope
A handy scope variable that starts a UnityEngine.Profiling.Profiler sample, and ends it when the scope ends
Implements
System.IDisposable
Namespace: Atlas
Assembly: Atlas.Runtime.dll
Syntax
public struct ProfilerScope : IDisposable
Examples
using UnityEngine;
namespace Atlas.Examples
{
public sealed class Example_ProfilerScope : MonoBehaviour
{
private void Update()
{
using ( new ProfilerScope( "Example" ) )
{
// code to measure...
}
}
}
}
Constructors
| Improve this Doc View SourceProfilerScope(String)
Constructor
Declaration
public ProfilerScope(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | A string to identify the sample in the Profiler window |
ProfilerScope(String, Object)
Constructor
Declaration
public ProfilerScope(string name, Object targetObject)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | A string to identify the sample in the Profiler window |
UnityEngine.Object | targetObject | An object that provides context to the sample |
Methods
| Improve this Doc View SourceDispose()
Ends the scope
Declaration
public void Dispose()
Implements
System.IDisposable