mscorlib(4.0.0.0) API with additions
|
Provides a set of methods and properties that you can use to accurately measure elapsed time.To browse the .NET Framework source code for this type, see the Reference Source. More...
Public Member Functions | |
Stopwatch () | |
Initializes a new instance of the T:System.Diagnostics.Stopwatch class. More... | |
void | Start () |
Starts, or resumes, measuring elapsed time for an interval. More... | |
void | Stop () |
Stops measuring elapsed time for an interval. More... | |
void | Reset () |
Stops time interval measurement and resets the elapsed time to zero. More... | |
void | Restart () |
Stops time interval measurement, resets the elapsed time to zero, and starts measuring elapsed time. More... | |
Static Public Member Functions | |
static Stopwatch | StartNew () |
Initializes a new T:System.Diagnostics.Stopwatch instance, sets the elapsed time property to zero, and starts measuring elapsed time. More... | |
static long | GetTimestamp () |
Gets the current number of ticks in the timer mechanism. More... | |
Static Public Attributes | |
static readonly long | Frequency |
Gets the frequency of the timer as the number of ticks per second. This field is read-only. More... | |
static readonly bool | IsHighResolution |
Indicates whether the timer is based on a high-resolution performance counter. This field is read-only. More... | |
Properties | |
bool | IsRunning [get] |
Gets a value indicating whether the T:System.Diagnostics.Stopwatch timer is running. More... | |
TimeSpan | Elapsed [get] |
Gets the total elapsed time measured by the current instance. More... | |
long | ElapsedMilliseconds [get] |
Gets the total elapsed time measured by the current instance, in milliseconds. More... | |
long | ElapsedTicks [get] |
Gets the total elapsed time measured by the current instance, in timer ticks. More... | |
Provides a set of methods and properties that you can use to accurately measure elapsed time.To browse the .NET Framework source code for this type, see the Reference Source.
Definition at line 7 of file Stopwatch.cs.
System.Diagnostics.Stopwatch.Stopwatch | ( | ) |
Initializes a new instance of the T:System.Diagnostics.Stopwatch class.
Definition at line 96 of file Stopwatch.cs.
|
static |
Gets the current number of ticks in the timer mechanism.
Definition at line 160 of file Stopwatch.cs.
void System.Diagnostics.Stopwatch.Reset | ( | ) |
Stops time interval measurement and resets the elapsed time to zero.
Definition at line 141 of file Stopwatch.cs.
void System.Diagnostics.Stopwatch.Restart | ( | ) |
Stops time interval measurement, resets the elapsed time to zero, and starts measuring elapsed time.
Definition at line 150 of file Stopwatch.cs.
void System.Diagnostics.Stopwatch.Start | ( | ) |
Starts, or resumes, measuring elapsed time for an interval.
Definition at line 103 of file Stopwatch.cs.
|
static |
Initializes a new T:System.Diagnostics.Stopwatch instance, sets the elapsed time property to zero, and starts measuring elapsed time.
Definition at line 115 of file Stopwatch.cs.
void System.Diagnostics.Stopwatch.Stop | ( | ) |
Stops measuring elapsed time for an interval.
Definition at line 124 of file Stopwatch.cs.
|
static |
Gets the frequency of the timer as the number of ticks per second. This field is read-only.
Definition at line 21 of file Stopwatch.cs.
|
static |
Indicates whether the timer is based on a high-resolution performance counter. This field is read-only.
Definition at line 25 of file Stopwatch.cs.
|
get |
Gets the total elapsed time measured by the current instance.
Definition at line 46 of file Stopwatch.cs.
|
get |
Gets the total elapsed time measured by the current instance, in milliseconds.
Definition at line 58 of file Stopwatch.cs.
|
get |
Gets the total elapsed time measured by the current instance, in timer ticks.
Definition at line 70 of file Stopwatch.cs.
|
get |
Gets a value indicating whether the T:System.Diagnostics.Stopwatch timer is running.
true
if the T:System.Diagnostics.Stopwatch instance is currently running and measuring elapsed time for an interval; otherwise, false
.Definition at line 34 of file Stopwatch.cs.