public void MeasureActiveStopwatchConstruction() { var assertComparisonTimer = Stopwatch.StartNew(); Startwatch measure = Startwatch.FromStopwatch(assertComparisonTimer); var loopTimer = Stopwatch.StartNew(); while (loopTimer.ElapsedTicks < Stopwatch.Frequency) { ; } assertComparisonTimer.Stop(); measure.Stop(); AssertStopwatch(assertComparisonTimer.ElapsedTicks, measure); }
public void MeasureActiveStopwatchConstructionWithOverplay() { var assertComparisonTimer = Stopwatch.StartNew(); Startwatch measure = Startwatch.FromStopwatch(assertComparisonTimer); var loopTimer = Stopwatch.StartNew(); while (loopTimer.ElapsedTicks < 2 * Stopwatch.Frequency) { if (loopTimer.ElapsedTicks > Stopwatch.Frequency) { assertComparisonTimer.Stop(); measure.Stop(); } } AssertStopwatch(assertComparisonTimer.ElapsedTicks, measure); }