public PauseHelper(TestStopwatch watch) { _watch = watch; }
public static void MeasureLaps(string name, int lapCount, Action<TestStopwatch> lapAction) { var sw = new TestStopwatch(false, 6); lapCount.Times( () => { lapAction(sw); sw.NewLap(); }); sw.Dispose(); decimal average = sw.LapAverage; decimal max = sw.SlowestLap; decimal min = sw.FastesLap; decimal sum = sw.Elapsed; decimal median = sw.Median; Console.WriteLine("{0,-50} {1,15}ms, Median: {5,12}ms, Average: {2,12}ms, Max: {4,12}ms, Min: {3,12}ms", lapCount + "x " + name, sum, average, min, max, median); }