Search Results for

    Show / Hide Table of Contents

    Class Stopwatch

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

    Inheritance
    Object
    Stopwatch
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: System.Diagnostics
    Assembly: System.Diagnostics.Stopwatch.dll
    Syntax
    public class Stopwatch

    Fields

    | Improve this Doc View Source

    Frequency

    Gets the frequency of the timer as the number of ticks per second. This field is read-only.

    Declaration
    public static readonly long Frequency
    Field Value
    Type Description
    Int64
    | Improve this Doc View Source

    IsHighResolution

    Indicates whether the timer is based on a high-resolution performance counter. This field is read-only.

    Declaration
    public static readonly bool IsHighResolution
    Field Value
    Type Description
    Boolean

    Properties

    | Improve this Doc View Source

    Elapsed

    Gets the total elapsed time measured by the current instance.

    Declaration
    public TimeSpan Elapsed { get; }
    Property Value
    Type Description
    TimeSpan
    | Improve this Doc View Source

    ElapsedMilliseconds

    Gets the total elapsed time measured by the current instance, in milliseconds.

    Declaration
    public long ElapsedMilliseconds { get; }
    Property Value
    Type Description
    Int64
    | Improve this Doc View Source

    ElapsedTicks

    Gets the total elapsed time measured by the current instance, in timer ticks.

    Declaration
    public long ElapsedTicks { get; }
    Property Value
    Type Description
    Int64
    | Improve this Doc View Source

    IsRunning

    Gets a value indicating whether the System.Diagnostics.Stopwatch timer is running.

    Declaration
    public bool IsRunning { get; }
    Property Value
    Type Description
    Boolean

    Methods

    | Improve this Doc View Source

    GetTimestamp()

    Gets the current number of ticks in the timer mechanism.

    Declaration
    public static long GetTimestamp()
    Returns
    Type Description
    Int64

    Number of ticks.

    | Improve this Doc View Source

    Reset()

    Stops time interval measurement and resets the elapsed time to zero.

    Declaration
    public void Reset()
    | Improve this Doc View Source

    Restart()

    Stops time interval measurement, resets the elapsed time to zero, and starts measuring elapsed time.

    Declaration
    public void Restart()
    | Improve this Doc View Source

    Start()

    Starts, or resumes, measuring elapsed time for an interval.

    Declaration
    public void Start()
    | Improve this Doc View Source

    StartNew()

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

    Declaration
    public static Stopwatch StartNew()
    Returns
    Type Description
    Stopwatch

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

    | Improve this Doc View Source

    Stop()

    Stops measuring elapsed time for an interval.

    Declaration
    public void Stop()
    • Improve this Doc
    • View Source
    In This Article
    Back to top Copyright © 2018 nanoFramework Contributors
    Generated by DocFX