Nerfed/Nerfed.Runtime/Profiler.cs

29 lines
514 B
C#
Raw Normal View History

using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
namespace Nerfed.Runtime;
public struct ProfilerScope : IDisposable
{
public ProfilerScope(string label) {
Profiler.BeginSample(label);
}
public void Dispose() {
Profiler.EndSample();
}
}
public static class Profiler
{
[Conditional("PROFILING")]
public static void BeginSample(string label) {
}
[Conditional("PROFILING")]
public static void EndSample() {
}
}