System.Diagnostics.Stopwatch

Summary


Provides a set of methods and properties that you can use to accurately measure elapsed time.
Defined in Stopwatch.js

Constructors

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

Methods

  • Int GetEllapsedMilliseconds()
    Gets the total elapsed time measured by the current instance, in milliseconds.

    Return Values

    An integer representing the total number of milliseconds measured by the current instance.
  • Bool IsRunning()
    Gets a value indicating whether the Stopwatch timer is running.

    Return Values

    True if the Stopwatch instance is currently running and measuring elapsed time for an interval; otherwise, false.
  • void Reset()
    Stops time interval measurement and resets the elapsed time to zero.
  • void Start()
    Starts, or resumes, measuring elapsed time for an interval.
  • void Stop()
    Stops measuring elapsed time for an interval.
  • static Stopwatch StartNew()
    Initializes a new Stopwatch instance, sets the elapsed time property to zero, and starts measuring elapsed time.

    Return Values

    A Stopwatch that has just begun measuring elapsed time.