Mono Class Library: System.TimeSpan Overview | Members

System.TimeSpan.TotalMilliseconds Property

Gets the value of the current instance expressed in milliseconds. [Edit]

public double TotalMilliseconds { get; }

Value

A double that specifies the total number of milliseconds represented by the current instance. [Edit]

Remarks

This property is read-only.

Note: This property converts the value of the current instance from ticks to milliseconds. This number can include whole and fractional milliseconds.

[Edit]

Example

This example demonstrates using the TimeSpan.TotalMilliseconds property.

C# Example
using System;
public class TimeSpanTotalUnitsProperties{
   public static void Main() {
      TimeSpan ts = new TimeSpan((Int64)10e12);
      Console.WriteLine(ts.ToString());
      Console.WriteLine("TotalMilliseconds: {0}", ts.TotalMilliseconds);
   }
}

The output is

11.13:46:40
TotalMilliseconds: 1000000000

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0