class · System.Diagnostics

Stopwatch

public class System.Diagnostics.Stopwatch : System.Any

Measures elapsed time, from the runtime's monotonic clock in nanoseconds.

Kind
class
Namespace
System.Diagnostics
Assembly
System.Core
Access
public, final
Source file
Runtime.ant

Inheritance

Base classes
Any Stopwatch

Properties

static property Frequency: i64
#

static read-only

Ticks of GetTimestamp and ElapsedTicks per second (they are nanoseconds).

static property IsHighResolution: bool
#

static read-only

property IsRunning: bool
#

read-only

property Elapsed: System.TimeSpan
#

read-only

property ElapsedMilliseconds: i64
#

read-only

property ElapsedTicks: i64
#

read-only

Methods

static method GetTimestamp() -> i64
#

static

The clock now, in ticks of Frequency.

static method GetElapsedTime(start: i64) -> System.TimeSpan
#

static

The time from a timestamp to now, and between two.

static method GetElapsedTime(start: i64, end: i64) -> System.TimeSpan
#

static

static method StartNew() -> System.Diagnostics.Stopwatch
#

static

method Start() -> void
#
method Stop() -> void
#
method Reset() -> void
#
method Restart() -> void
#

Private and internal members (5)

field started: i64
#

private

field elapsed: i64
#

private

field running: bool
#

private

static method Now() -> i64
#

private static

method Nanoseconds() -> i64
#

private

Nanoseconds so far.

Inherited members (5)

Source

Stopwatch as Larva HIR, decompiled from its Larva HIR.

System.Diagnostics.Stopwatch.hir
// Measures elapsed time, from the runtime's monotonic clock in nanoseconds.
public class System.Diagnostics.Stopwatch : System.Any
{
    field started: i64
    field elapsed: i64
    field running: bool
    static method Now() -> i64
    // Nanoseconds so far.
    method Nanoseconds() -> i64
    // The clock now, in ticks of Frequency.
    static method GetTimestamp() -> i64
    // The time from a timestamp to now, and between two.
    static method GetElapsedTime(start: i64) -> System.TimeSpan
    static method GetElapsedTime(start: i64, end: i64) -> System.TimeSpan
    static method StartNew() -> System.Diagnostics.Stopwatch
    method Start() -> void
    method Stop() -> void
    method Reset() -> void
    method Restart() -> void
    // Ticks of GetTimestamp and ElapsedTicks per second (they are nanoseconds).
    static property Frequency: i64
    static property IsHighResolution: bool
    property IsRunning: bool
    property Elapsed: System.TimeSpan
    property ElapsedMilliseconds: i64
    property ElapsedTicks: i64
}
Esc