System.Diagnostics.Stopwatch.StartNew Method

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

Syntax

public static Stopwatch StartNew ()

Returns

A System.Diagnostics.Stopwatch that has just begun measuring elapsed time.

Remarks

This method is equivalent to calling the System.Diagnostics.Stopwatch constructor and then calling Stopwatch.Start on the new instance.

Requirements

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