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

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

TimeSpan.TicksPerMillisecond フィールド

タイマ刻みの数を 1 ミリ秒表します。このフィールド定数です。

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

Public Const TicksPerMillisecond As
 Long
Dim value As Long

value = TimeSpan.TicksPerMillisecond
public const long TicksPerMillisecond
public:
literal long long TicksPerMillisecond
public static final long TicksPerMillisecond
public const var TicksPerMillisecond
 : long
解説解説

この定数の値は 1 万、つまり 10,000 です。

使用例使用例

TicksPerMillisecond フィールドの値を参照して表示するコード例次に示します

' Example of the TimeSpan fields.
Imports System
Imports Microsoft.VisualBasic

Module TimeSpanFieldsDemo
    
    ' Pad the end of a TimeSpan string with spaces if it does not 
    ' contain milliseconds.
    Function Align( interval As TimeSpan )
 As String

        Dim intervalStr As String
 = interval.ToString( )
        Dim pointIndex  As Integer
 = intervalStr.IndexOf( ":"c )

        pointIndex = intervalStr.IndexOf( "."c, pointIndex
 )
        If pointIndex < 0 Then intervalStr
 &= "        "
        Align = intervalStr
    End Function
    
    Sub Main( )

        Const numberFmt As String
 = "{0,-22}{1,18:N0}"
        Const timeFmt As String
 = "{0,-22}{1,26}"

        Console.WriteLine( _
            "This example of the fields of the TimeSpan class"
 & _
            vbCrLf & "generates the following output."
 & vbCrLf )
        Console.WriteLine( numberFmt, "Field", "Value"
 )
        Console.WriteLine( numberFmt, "-----", "-----"
 )

        ' Display the maximum, minimum, and zero TimeSpan values.
        Console.WriteLine( timeFmt, "Maximum TimeSpan",
 _
            Align( TimeSpan.MaxValue ) )
        Console.WriteLine( timeFmt, "Minimum TimeSpan",
 _
            Align( TimeSpan.MinValue ) )
        Console.WriteLine( timeFmt, "Zero TimeSpan",
 _
            Align( TimeSpan.Zero ) )
        Console.WriteLine( )

        ' Display the ticks-per-time-unit fields.
        Console.WriteLine( numberFmt, "Ticks per day",
 _
            TimeSpan.TicksPerDay )
        Console.WriteLine( numberFmt, "Ticks per hour",
 _
            TimeSpan.TicksPerHour )
        Console.WriteLine( numberFmt, "Ticks per minute",
 _
            TimeSpan.TicksPerMinute )
        Console.WriteLine( numberFmt, "Ticks per second",
 _
            TimeSpan.TicksPerSecond )
        Console.WriteLine( numberFmt, "Ticks per millisecond",
 _
            TimeSpan.TicksPerMillisecond )
    End Sub 
End Module 

' This example of the fields of the TimeSpan class
' generates the following output.
' 
' Field                              Value
' -----                              -----
' Maximum TimeSpan       10675199.02:48:05.4775807
' Minimum TimeSpan      -10675199.02:48:05.4775808
' Zero TimeSpan                   00:00:00
' 
' Ticks per day            864,000,000,000
' Ticks per hour            36,000,000,000
' Ticks per minute             600,000,000
' Ticks per second              10,000,000
' Ticks per millisecond             10,000
// Example of the TimeSpan fields.
using System;

class TimeSpanFieldsDemo
{
    // Pad the end of a TimeSpan string with spaces if it does not 
    // contain milliseconds.
    static string Align( TimeSpan interval
 )
    {
        string  intervalStr = interval.ToString( );
        int     pointIndex = intervalStr.IndexOf( ':' );

        pointIndex = intervalStr.IndexOf( '.', pointIndex );
        if( pointIndex < 0 ) intervalStr += "        ";
        return intervalStr;
    } 

    static void Main( )
    {
        const string numberFmt = "{0,-22}{1,18:N0}"
 ;
        const string timeFmt = "{0,-22}{1,26}"
 ;

        Console.WriteLine( 
            "This example of the fields of the TimeSpan class"
 +
            "\ngenerates the following output.\n" );
        Console.WriteLine( numberFmt, "Field", "Value" );
        Console.WriteLine( numberFmt, "-----", "-----" );

        // Display the maximum, minimum, and zero TimeSpan values.
        Console.WriteLine( timeFmt, "Maximum TimeSpan", 
            Align( TimeSpan.MaxValue ) );
        Console.WriteLine( timeFmt, "Minimum TimeSpan", 
            Align( TimeSpan.MinValue ) );
        Console.WriteLine( timeFmt, "Zero TimeSpan", 
            Align( TimeSpan.Zero ) );
        Console.WriteLine( );

        // Display the ticks-per-time-unit fields.
        Console.WriteLine( numberFmt, "Ticks per day", 
            TimeSpan.TicksPerDay );
        Console.WriteLine( numberFmt, "Ticks per hour", 
            TimeSpan.TicksPerHour );
        Console.WriteLine( numberFmt, "Ticks per minute", 
            TimeSpan.TicksPerMinute );
        Console.WriteLine( numberFmt, "Ticks per second", 
            TimeSpan.TicksPerSecond );
        Console.WriteLine( numberFmt, "Ticks per millisecond", 
            TimeSpan.TicksPerMillisecond );
    }
} 

/*
This example of the fields of the TimeSpan class
generates the following output.

Field                              Value
-----                              -----
Maximum TimeSpan       10675199.02:48:05.4775807
Minimum TimeSpan      -10675199.02:48:05.4775808
Zero TimeSpan                   00:00:00

Ticks per day            864,000,000,000
Ticks per hour            36,000,000,000
Ticks per minute             600,000,000
Ticks per second              10,000,000
Ticks per millisecond             10,000
*/
// Example of the TimeSpan fields.
using namespace System;

// Pad the end of a TimeSpan string with spaces if it does not 
// contain milliseconds.
String^ Align( TimeSpan interval )
{
   String^ intervalStr = interval.ToString();
   int pointIndex = intervalStr->IndexOf( ':' );
   pointIndex = intervalStr->IndexOf( '.', pointIndex );
   if ( pointIndex < 0 )
      intervalStr = String::Concat( intervalStr, "        " );

   return intervalStr;
}

int main()
{
   String^ numberFmt = "{0,-22}{1,18:N0}";
   String^ timeFmt = "{0,-22}{1,26}";
   Console::WriteLine( "This example of the fields of the TimeSpan class"
   "\ngenerates the following output.\n" );
   Console::WriteLine( numberFmt, "Field", "Value" );
   Console::WriteLine( numberFmt, "-----", "-----" );
   
   // Display the maximum, minimum, and zero TimeSpan values.
   Console::WriteLine( timeFmt, "Maximum TimeSpan", Align( TimeSpan::MaxValue
 ) );
   Console::WriteLine( timeFmt, "Minimum TimeSpan", Align( TimeSpan::MinValue
 ) );
   Console::WriteLine( timeFmt, "Zero TimeSpan", Align( TimeSpan::Zero
 ) );
   Console::WriteLine();
   
   // Display the ticks-per-time-unit fields.
   Console::WriteLine( numberFmt, "Ticks per day", TimeSpan::TicksPerDay
 );
   Console::WriteLine( numberFmt, "Ticks per hour", TimeSpan::TicksPerHour
 );
   Console::WriteLine( numberFmt, "Ticks per minute", TimeSpan::TicksPerMinute
 );
   Console::WriteLine( numberFmt, "Ticks per second", TimeSpan::TicksPerSecond
 );
   Console::WriteLine( numberFmt, "Ticks per millisecond", TimeSpan::TicksPerMillisecond
 );
}

/*
This example of the fields of the TimeSpan class
generates the following output.

Field                              Value
-----                              -----
Maximum TimeSpan       10675199.02:48:05.4775807
Minimum TimeSpan      -10675199.02:48:05.4775808
Zero TimeSpan                   00:00:00

Ticks per day            864,000,000,000
Ticks per hour            36,000,000,000
Ticks per minute             600,000,000
Ticks per second              10,000,000
Ticks per millisecond             10,000
*/
// Example of the TimeSpan fields.
import System.*;

class TimeSpanFieldsDemo
{
    // Pad the end of a TimeSpan string with spaces if it does not 
    // contain milliseconds.
    static String Align(TimeSpan interval)
    {
        String intervalStr = interval.ToString();
        int pointIndex = intervalStr.IndexOf(':');

        pointIndex = intervalStr.IndexOf('.', pointIndex);
        if (pointIndex < 0) {
            intervalStr += "        ";
        }
        return intervalStr;
    } //Align

    public static void main(String[]
 args)
    {
        final String numberFmt = "{0,-22}{1,18}";
        final String timeFmt = "{0,-22}{1,26}";

        Console.WriteLine(("This example of the fields of the TimeSpan class"
 
            + "\ngenerates the following output.\n"));
        Console.WriteLine(numberFmt, "Field", "Value");
        Console.WriteLine(numberFmt, "-----", "-----");

        // Display the maximum, minimum, and zero TimeSpan values.
        Console.WriteLine(timeFmt, "Maximum TimeSpan", 
            Align(TimeSpan.MaxValue));
        Console.WriteLine(timeFmt, "Minimum TimeSpan",
            Align(TimeSpan.MinValue));
        Console.WriteLine(timeFmt, "Zero TimeSpan", Align(TimeSpan.Zero));
        Console.WriteLine();

        // Display the ticks-per-time-unit fields.
        Console.WriteLine(numberFmt, "Ticks per day", 
            ((System.Int64)TimeSpan.TicksPerDay).ToString("N0"));
        Console.WriteLine(numberFmt, "Ticks per hour", 
            ((System.Int64)TimeSpan.TicksPerHour).ToString("N0"));
        Console.WriteLine(numberFmt, "Ticks per minute", 
            ((System.Int64)TimeSpan.TicksPerMinute).ToString("N0"));
        Console.WriteLine(numberFmt, "Ticks per second", 
            ((System.Int64)TimeSpan.TicksPerSecond).ToString("N0"));
        Console.WriteLine(numberFmt, "Ticks per millisecond", 
            ((System.Int64)TimeSpan.TicksPerMillisecond).ToString("N0"));
    } //main
} //TimeSpanFieldsDemo

/*
This example of the fields of the TimeSpan class
generates the following output.

Field                              Value
-----                              -----
Maximum TimeSpan       10675199.02:48:05.4775807
Minimum TimeSpan      -10675199.02:48:05.4775808
Zero TimeSpan                   00:00:00

Ticks per day            864,000,000,000
Ticks per hour            36,000,000,000
Ticks per minute             600,000,000
Ticks per second              10,000,000
Ticks per millisecond             10,000
*/
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
TimeSpan 構造体
TimeSpan メンバ
System 名前空間
Int64 構造体
TicksPerSecond
TicksPerMinute
TicksPerHour
TicksPerDay



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

辞書ショートカット

すべての辞書の索引

「TimeSpan.TicksPerMillisecond フィールド」の関連用語

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

   

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



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

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

©2024 GRAS Group, Inc.RSS