Stopwatch.IsHighResolution フィールド
アセンブリ: System (system.dll 内)


Stopwatch クラスで使用されるタイマは、システムのハードウェアおよびオペレーティング システムによって異なります。Stopwatch タイマが高解像力のパフォーマンス カウンタに基づいている場合、IsHighResolution は true になります。それ以外の場合、IsHighResolution は false になります。つまり、Stopwatch タイマがシステム タイマに基づいていることを示します。

Stopwatch クラスの頻度および解像力を表示する例を次に示します。
Public Shared Sub DisplayTimerProperties() ' Display the timer frequency and resolution. If Stopwatch.IsHighResolution Then Console.WriteLine("Operations timed using the system's high-resolution performance counter.") Else Console.WriteLine("Operations timed using the DateTime class.") End If Dim frequency As Long = Stopwatch.Frequency Console.WriteLine(" Timer frequency in ticks per second = {0}", frequency) Dim nanosecPerTick As Long = 1000000000 / frequency Console.WriteLine(" Timer is accurate within {0} nanoseconds", nanosecPerTick) End Sub
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."); } else { Console.WriteLine("Operations timed using the DateTime class."); } long frequency = Stopwatch.Frequency; Console.WriteLine(" Timer frequency in ticks per second = {0}", frequency); long nanosecPerTick = (1000L*1000L*1000L) / frequency; Console.WriteLine(" Timer is accurate within {0} nanoseconds", nanosecPerTick); }
void DisplayTimerProperties() { // Display the timer frequency and resolution. if ( Stopwatch::IsHighResolution ) { Console::WriteLine( "Operations timed using the system's high-resolution performance counter." ); } else { Console::WriteLine( "Operations timed using the DateTime class." ); } Int64 frequency = Stopwatch::Frequency; Console::WriteLine( " Timer frequency in ticks per second = {0}", frequency ); Int64 nanosecPerTick = (1000L * 1000L * 1000L) / frequency; Console::WriteLine( " Timer is accurate within {0} nanoseconds", nanosecPerTick ); }
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."); } else { Console.WriteLine("Operations timed using the DateTime class."); } long frequency = Stopwatch.Frequency; Console.WriteLine(" Timer frequency in ticks per second = {0}", (Int64)frequency); long nanoSecPerTick = (1000L * 1000L * 1000L) / frequency; Console.WriteLine(" Timer is accurate within {0} nanoseconds", (Int64)nanoSecPerTick); } //DisplayTimerProperties

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からStopwatch.IsHighResolution フィールドを検索する場合は、下記のリンクをクリックしてください。

- Stopwatch.IsHighResolution フィールドのページへのリンク