public static ProfilerStopper StartNew(this IProfiler profiler, Action <long> profilerAction) { if (profiler is null) { throw new ArgumentNullException(nameof(profiler)); } profiler.Restart(); return(new ProfilerStopper(profiler, profilerAction)); }