System.Diagnostics.Stopwatch.Restart Method

Stops time interval measurement, resets the elapsed time to zero, and starts measuring elapsed time.

Syntax

public void Restart ()

Remarks

A System.Diagnostics.Stopwatch instance calculates and retains the cumulative elapsed time across multiple time intervals, until the instance is reset or restarted. Use Stopwatch.Stop to stop the current interval measurement and retain the cumulative elapsed time value. Use Stopwatch.Reset to stop any interval measurement in progress and clear the elapsed time value. Use Stopwatch.Restart to stop current interval measurement and start a new interval measurement.

Requirements

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