Gets the milliseconds component of the time interval represented by the current TimeSpan structure.
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.
A TimeSpan value can be represented as [-]d.hh:mm:ss.ff, where the optional minus sign indicates a negative time interval, the d component is days, hh is hours as measured on a 24-hour clock, mm is minutes, ss is seconds, and ff is fractions of a second. The value of the TimeSpan.Milliseconds property is the fractional second component, ff.
The TimeSpan.Milliseconds property represents whole milliseconds, whereas the TimeSpan.TotalMilliseconds property represents whole and fractional milliseconds.
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