using e_suite.Service.Performance.Interfaces;

namespace e_suite.Service.Performance.Implementations;

public class Stopwatch : IStopwatch
{
    public static Stopwatch StartNew()
    {
        return new Stopwatch(System.Diagnostics.Stopwatch.StartNew());
    }

    private System.Diagnostics.Stopwatch _stopwatch;

    public Stopwatch(System.Diagnostics.Stopwatch stopwatch)
    {
        _stopwatch = stopwatch;
    }

    public TimeSpan Elapsed => _stopwatch.Elapsed;
    public void Stop() => _stopwatch.Stop();
}
