You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

31 lines
681 B

namespace DealerSelection.Common.Profiler
{
public class PerformanceProfiler : IDisposable
{
private bool disposed;
public PerformanceProfiler(string operationName)
{
Profiler.StartOperation($"Custom - {operationName}");
}
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
protected virtual void Dispose(bool disposing)
{
if (!disposed)
{
if (disposing)
{
Profiler.EndOperation();
}
disposed = true;
}
}
}
}