37 lines
698 B
C#
Executable File
37 lines
698 B
C#
Executable File
using System.Diagnostics;
|
|
|
|
// Filename: Profiler.cs
|
|
// Author:Sean Kessler
|
|
|
|
namespace MarketData.Utils
|
|
{
|
|
/// <summary>Profiler - Profiler utility class</summary>
|
|
public class Profiler
|
|
{
|
|
private Stopwatch watch = default;
|
|
|
|
public Profiler()
|
|
{
|
|
watch = System.Diagnostics.Stopwatch.StartNew();
|
|
}
|
|
public void Reset()
|
|
{
|
|
watch = System.Diagnostics.Stopwatch.StartNew();
|
|
}
|
|
public void Start()
|
|
{
|
|
watch = System.Diagnostics.Stopwatch.StartNew();
|
|
}
|
|
public long Stop()
|
|
{
|
|
return End();
|
|
}
|
|
public long End()
|
|
{
|
|
watch.Stop();
|
|
return watch.ElapsedMilliseconds;
|
|
}
|
|
}
|
|
}
|
|
|