System.Diagnostics.Stopwatch.ElapsedMilliseconds Property

Gets the total elapsed time measured by the current instance, in milliseconds.


public long ElapsedMilliseconds { get; }


Documentation for this section has not yet been entered.


This property represents elapsed time rounded down to the nearest whole millisecond value. For higher precision measurements, use the Stopwatch.Elapsed or Stopwatch.ElapsedTicks properties.

You can query the properties Stopwatch.Elapsed, Stopwatch.ElapsedMilliseconds, and Stopwatch.ElapsedTicks while the System.Diagnostics.Stopwatch instance is running or stopped. The elapsed time properties steadily increase while the System.Diagnostics.Stopwatch is running; they remain constant when the instance is stopped.

By default, the elapsed time value of a System.Diagnostics.Stopwatch instance equals the total of all measured time intervals. Each call to Stopwatch.Start begins counting at the cumulative elapsed time; each call to Stopwatch.Stop ends the current interval measurement and freezes the cumulative elapsed time value. Use the Stopwatch.Reset method to clear the cumulative elapsed time in an existing System.Diagnostics.Stopwatch instance.


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