System.Diagnostics.Stopwatch Members

The members of System.Diagnostics.Stopwatch are listed below.

See Also: Inherited members from System.Object

Public Constructors

Initializes a new instance of the System.Diagnostics.Stopwatch class.

Public Fields

static readonly
Frequencylong (10000000).

Gets the frequency of the timer as the number of ticks per second. This field is read-only.

static readonly
IsHighResolutionbool.

Indicates whether the timer is based on a high-resolution performance counter. This field is read-only.

Public Properties

[read-only]
ElapsedTimeSpan.

Gets the total elapsed time measured by the current instance.

[read-only]
ElapsedMillisecondslong.

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

[read-only]
ElapsedTickslong.

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

[read-only]
IsRunningbool.

Gets a value indicating whether the System.Diagnostics.Stopwatch timer is running.

Public Methods

static
GetTimestamp() : long

Gets the current number of ticks in the timer mechanism.

Reset()

Stops time interval measurement and resets the elapsed time to zero.

Restart()

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

Start()

Starts, or resumes, measuring elapsed time for an interval.

static
StartNew() : Stopwatch

Initializes a new System.Diagnostics.Stopwatch instance, sets the elapsed time property to zero, and starts measuring elapsed time.

Stop()

Stops measuring elapsed time for an interval.