Mono Class Library: System.TimeSpan Overview | Members

System.TimeSpan.Milliseconds Property

Gets the number of milliseconds represented by the current instance.

public int Milliseconds { get; }

Value

A int between 0 and 999 inclusive, that represents the fractional seconds component of the current instance converted to milliseconds.
Note: See TimeSpan.ToString for a more detailed description of the fractional seconds component.

Remarks

This property is read-only.

Example

This example demonstrates using the TimeSpan.Milliseconds property.

C# Example

using System;
public class TimeSpanPropertiesExampleOne {
   public static void Main() {
      TimeSpan ts = new TimeSpan((Int64)10e12+3456789);
      Console.WriteLine(ts.ToString());
      Console.WriteLine("Milliseconds: {0}", ts.Milliseconds );
   }
}

The output is

11.13:46:40.3456789
Milliseconds: 345

Requirements

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