Stopwatch.IsHighResolution Field


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

Namespace:   System.Diagnostics
Assembly:  System (in System.dll)

public static readonly bool IsHighResolution

Field Value

Type: System.Boolean

The timer used by the Stopwatch class depends on the system hardware and operating system. IsHighResolution is true if the Stopwatch timer is based on a high-resolution performance counter. Otherwise, IsHighResolution is false, which indicates that the Stopwatch timer is based on the system timer.

The following example displays the frequency and resolution of a Stopwatch timer. This code example is part of a larger example provided for the Stopwatch class.

public static void DisplayTimerProperties()
    // Display the timer frequency and resolution.
    if (Stopwatch.IsHighResolution)
        Console.WriteLine("Operations timed using the system's high-resolution performance counter.");
        Console.WriteLine("Operations timed using the DateTime class.");

    long frequency = Stopwatch.Frequency;
    Console.WriteLine("  Timer frequency in ticks per second = {0}",
    long nanosecPerTick = (1000L*1000L*1000L) / frequency;
    Console.WriteLine("  Timer is accurate within {0} nanoseconds", 

Universal Windows Platform
Available since 4.5
.NET Framework
Available since 2.0
Portable Class Library
Supported in: portable .NET platforms
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Return to top
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
© 2015 Microsoft