System.Diagnostics.Stopwatch.ElapsedTicks Property

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

Syntax

public long ElapsedTicks { get; }

Value

Documentation for this section has not yet been entered.

Remarks

This property represents the number of elapsed ticks in the underlying timer mechanism. A tick is the smallest unit of time that the System.Diagnostics.Stopwatch timer can measure. Use the Stopwatch.Frequency field to convert the Stopwatch.ElapsedTicks value into a number of seconds.

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.

Note:

System.Diagnostics.Stopwatch ticks are different from DateTime.Ticks. Each tick in the DateTime.Ticks value represents one 100-nanosecond interval. Each tick in the Stopwatch.ElapsedTicks value represents the time interval equal to 1 second divided by the Stopwatch.Frequency.

Requirements

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