using System; using System.Diagnostics; namespace Alkami.Ops.Certificates.Utilities { /// /// A convenience class that writes stopwatch start/stop messages inside using blocks. /// internal class QuickWatch : IDisposable { public readonly string Name; public readonly Stopwatch StopWatch; public QuickWatch(string name) { Name = name; StopWatch = new Stopwatch(); Console.WriteLine($"Starting [{Name}]"); StopWatch.Start(); } public void Dispose() { Console.WriteLine($"[{Name}] completed in {StopWatch.Elapsed}"); StopWatch.Stop(); } } }