System.Diagnostics.Stopwatch.Stop Method

Stops measuring elapsed time for an interval.

Syntax

public void Stop ()

Remarks

In a typical System.Diagnostics.Stopwatch scenario, you call the Stopwatch.Start method, then eventually call the Stopwatch.Stop method, and then you check elapsed time using the Stopwatch.Elapsed property.

The Stopwatch.Stop method ends the current time interval measurement. Stopping a System.Diagnostics.Stopwatch that is not running does not change the timer state or reset the elapsed time properties.

When a System.Diagnostics.Stopwatch instance measures more than one interval, the Stopwatch.Stop method is equivalent to pausing the elapsed time measurement. A subsequent call to Stopwatch.Start resumes measuring time from the current elapsed time value. Use the Stopwatch.Reset method to clear the cumulative elapsed time in a System.Diagnostics.Stopwatch instance.

Requirements

Namespace: System.Diagnostics
Assembly: System (in System.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0
Since: .NET 2.0