2024-07-05 14:32:58 +02:00
|
|
|
|
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
|
|
|
|
|
{
|
2024-07-11 23:46:32 +02:00
|
|
|
|
[Conditional("PROFILING")]
|
2024-07-05 14:32:58 +02:00
|
|
|
|
public static void BeginSample(string label) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2024-07-11 23:46:32 +02:00
|
|
|
|
[Conditional("PROFILING")]
|
2024-07-05 14:32:58 +02:00
|
|
|
|
public static void EndSample() {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|