class StopWatch

namespace sys.core
class StopWatch

A class used to measure the time delta between two events.

Constructors

this

this{};

Brief

Creates a new instance and starts keeping track of time.

Calling `Elapsed` after is a valid operation.


Stopped

this Stopped{};

Brief

Creates a new instance but does not start tracking time.

Calling `Elapsed` after is a not valid operation and you must manually start keeping track of time by calling `Reset`.

Methods

Reset

def Reset();

Brief

Resets the internal statistics and starts tracking time from the point in time of the call.


Elapsed

func Elapsed(): Double;

Brief

Returns the elapsed time from the last time the tracking of time started, in milliseconds.

Returns

elapsed milliseconds

Properties

IsHighResolution

property IsHighResolution: Bool; get;

Brief

Returns `true` if the timer is a high resolution timer, with improved granularity.