Environment.TickCount プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > Environment.TickCount プロパティの意味・解説 

Environment.TickCount プロパティ

システム起動後のミリ秒単位経過時間取得します

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

解説解説

このプロパティの値はシステム タイマから取得され32 ビット符号付き整数として格納されます。そのため、システム終了せずに実行し続けた場合TickCountゼロから Int32.MaxValue (約 24.9 日) までインクリメントされた後、いったん Int32.MinValue (負数) になり、再び、ゼロ戻ってから、次の 24.9 日までインクリメントされます

TickCount プロパティ解像度は、500 ミリ秒未満には設定できません。

TickCount は、西暦 1 年 1 月 1 日午前 12:00 時からの経過時間100 ナノ秒単位で示す Ticks プロパティとは異なります

このコンピュータ現在のローカルな日付と時刻取得するには、DateTime.Now プロパティ使用します

使用例使用例

TickCount プロパティから返される正数範囲の値を取得する方法次のコード例示しますTickCount プロパティは、負数である Int32.MinValue から Int32.MaxValue までを 1 サイクル (49.8 日) として動作します。このコード サンプルでは、ゼロから MaxValue を 1 サイクル (24.9 日) とする負数以外の数値取得するために、符号ビット取り除く処理を行ってます。

' Sample for the Environment.TickCount property.
' TickCount cycles between Int32.MinValue, which is a negative 
' number, and Int32.MaxValue once every 49.8 days. This sample
' removes the sign bit to yield a nonnegative number that cycles 
' between zero and Int32.MaxValue once every 24.9 days.

Imports System

Class Sample
   Public Shared Sub Main()
      Dim result As Integer
 = Environment.TickCount And Int32.MaxValue

      Console.WriteLine("TickCount: {0}", result)
   End Sub 'Main
End Class 'Sample
'
'This example produces the following results:
'
'TickCount: 101931139
'
// Sample for the Environment.TickCount property.

// TickCount cycles between Int32.MinValue, which is a negative 
// number, and Int32.MaxValue once every 49.8 days. This sample
// removes the sign bit to yield a nonnegative number that cycles 
// between zero and Int32.MaxValue once every 24.9 days.

using System;

class Sample 
{
    public static void Main()
 
    {
    int result = Environment.TickCount & Int32.MaxValue;
    Console.WriteLine("TickCount: {0}", result);
    }
}
/*
This example produces the following results:

TickCount: 101931139
*/
// Sample for the Environment::TickCount property
// TickCount cycles between Int32::MinValue, which is a negative 
// number, and Int32::MaxValue once every 49.8 days. This sample
// removes the sign bit to yield a nonnegative number that cycles 
// between zero and Int32::MaxValue once every 24.9 days.
using namespace System;
int main()
{
   int result = Environment::TickCount & Int32::MaxValue;
   Console::WriteLine( "TickCount: {0}", result );
}

/*
This example produces the following results:

TickCount: 101931139
*/
// Sample for the Environment.TickCount property

import System.*;

class Sample
{
    public static void main(String[]
 args)
    {
        Console.WriteLine();
        Console.WriteLine("TickCount: {0}", 
            System.Convert.ToString(Environment.get_TickCount()));
    } //main
} //Sample

/*
This example produces the following results:

TickCount: 17995355
*/
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



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

辞書ショートカット

すべての辞書の索引

「Environment.TickCount プロパティ」の関連用語

Environment.TickCount プロパティのお隣キーワード
検索ランキング

   

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



Environment.TickCount プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2025 GRAS Group, Inc.RSS