25 lines
459 B
C#
25 lines
459 B
C#
using System;
|
|
using FlaxEngine;
|
|
|
|
namespace Game;
|
|
|
|
public static class Utilities
|
|
{
|
|
public static ScopeProfiler ProfileScope(string eventName)
|
|
{
|
|
return new ScopeProfiler(eventName);
|
|
}
|
|
|
|
public class ScopeProfiler : IDisposable
|
|
{
|
|
public ScopeProfiler(string eventName)
|
|
{
|
|
Profiler.BeginEvent(eventName);
|
|
}
|
|
|
|
public void Dispose()
|
|
{
|
|
Profiler.EndEvent();
|
|
}
|
|
}
|
|
} |