diff --git a/Editor/ProfilerScope.cs b/Editor/ProfilerScope.cs index fc1f7e5..956f3bc 100644 --- a/Editor/ProfilerScope.cs +++ b/Editor/ProfilerScope.cs @@ -1,13 +1,20 @@ -using System; +#nullable enable + +using System; +using JetBrains.Annotations; using UnityEngine.Profiling; namespace nadena.dev.ndmf { - internal struct ProfilerScope : IDisposable + /// + /// Performs a `Profiler.BeginSample` call on construction, and `Profiler.EndSample` on disposal. + /// + [PublicAPI] + public struct ProfilerScope : IDisposable { - public ProfilerScope(string name) + public ProfilerScope(string name, UnityEngine.Object? target = null) { - Profiler.BeginSample(name); + Profiler.BeginSample(name, target); } public void Dispose()