C# TimeSpan FromMilliseconds
Description
TimeSpan FromMilliseconds
returns a TimeSpan that represents
a specified number of milliseconds.
Syntax
TimeSpan.FromMilliseconds
has the following syntax.
public static TimeSpan FromMilliseconds(
double value
)
Parameters
TimeSpan.FromMilliseconds
has the following parameters.
value
- A number of milliseconds.
Returns
TimeSpan.FromMilliseconds
method returns An object that represents value.
Example
The following example creates several TimeSpan objects by using the FromMilliseconds method.
using System;/* ww w . ja v a2 s . co m*/
class MainClass
{
static void Main( )
{
TimeSpan interval = TimeSpan.FromMilliseconds( 6 );
string timeInterval = interval.ToString( );
Console.WriteLine( timeInterval );
}
}
The code above generates the following result.