using System.Diagnostics; // Filename: Profiler.cs // Author:Sean Kessler namespace MarketData.Utils { /// Profiler - Profiler utility class 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; } } }