# TimeSpan.TicksPerHour フィールド

2013/12/12

タイマー刻みの数を 1 時間で表します。このフィールドは定数です。

Namespace:  System
アセンブリ:  mscorlib (mscorlib.dll 内)

## 構文

```public const long TicksPerHour
```

## 解説

この定数の値は 36 億、つまり 36,000,000,000 です。

## 例

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

```
// Example of the TimeSpan fields.
using System;

class Example
{
// 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;
}

public static void Demo(System.Windows.Controls.TextBlock outputBlock)
{
const string numberFmt = "{0,-22}{1,18:N0}";
const string timeFmt = "{0,-22}{1,26}";

outputBlock.Text +=
"This example of the fields of the TimeSpan class" +
"\ngenerates the following output.\n" + "\n";
outputBlock.Text += String.Format(numberFmt, "Field", "Value") + "\n";
outputBlock.Text += String.Format(numberFmt, "-----", "-----") + "\n";

// Display the maximum, minimum, and zero TimeSpan values.
outputBlock.Text += String.Format(timeFmt, "Maximum TimeSpan",
Align(TimeSpan.MaxValue)) + "\n";
outputBlock.Text += String.Format(timeFmt, "Minimum TimeSpan",
Align(TimeSpan.MinValue)) + "\n";
outputBlock.Text += String.Format(timeFmt, "Zero TimeSpan",
Align(TimeSpan.Zero)) + "\n";
outputBlock.Text += "\n";

// Display the ticks-per-time-unit fields.
outputBlock.Text += String.Format(numberFmt, "Ticks per day",
TimeSpan.TicksPerDay) + "\n";
outputBlock.Text += String.Format(numberFmt, "Ticks per hour",
TimeSpan.TicksPerHour) + "\n";
outputBlock.Text += String.Format(numberFmt, "Ticks per minute",
TimeSpan.TicksPerMinute) + "\n";
outputBlock.Text += String.Format(numberFmt, "Ticks per second",
TimeSpan.TicksPerSecond) + "\n";
outputBlock.Text += String.Format(numberFmt, "Ticks per millisecond",
TimeSpan.TicksPerMillisecond) + "\n";
}
}

/*
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
*/

```

## バージョン情報

#### Windows Phone OS

サポート: 8.0, 7.1, 7.0

Windows Phone