Initial Commit
This commit is contained in:
36
MarketData/MarketDataLib/Utility/Profiler.cs
Executable file
36
MarketData/MarketDataLib/Utility/Profiler.cs
Executable file
@@ -0,0 +1,36 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user