Stopwatch.Frequency フィールドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > Stopwatch.Frequency フィールドの意味・解説 

Stopwatch.Frequency フィールド

メモ : このフィールドは、.NET Framework version 2.0新しく追加されたものです。

1 秒あたりのタイマ刻みの数として、タイマ頻度取得します。このフィールド読み取り専用です。

名前空間: System.Diagnostics
アセンブリ: System (system.dll 内)
構文構文

解説解説
使用例使用例

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
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「Stopwatch.Frequency フィールド」の関連用語

Stopwatch.Frequency フィールドのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



Stopwatch.Frequency フィールドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2024 Microsoft.All rights reserved.

©2024 GRAS Group, Inc.RSS