TimeSpan.FromMilliseconds Method (Double)
Returns a TimeSpan that represents a specified number of milliseconds.
Assembly: mscorlib (in mscorlib.dll)
Parameters
- value
-
Type:
System.Double
A number of milliseconds.
| Exception | Condition |
|---|---|
| OverflowException | value is less than MinValue or greater than MaxValue. -or- value is Double.PositiveInfinity. -or- value is Double.NegativeInfinity. |
| ArgumentException | value is equal to Double.NaN. |
The value parameter is converted to ticks, and that number of ticks is used to initialize the new TimeSpan. Therefore, value will only be considered accurate to the nearest millisecond. Note that, because of the loss of precision of the Double data type, this conversion can generate an OverflowException for values that are near to but still in the range of either MinValue or MaxValue. For example, this causes an OverflowException in the following attempt to instantiate a TimeSpan object.
Available since 8
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1