C# TimeSpan FromTicks
Description
TimeSpan FromTicks
returns a TimeSpan that represents
a specified time, where the specification is in units of ticks.
Syntax
TimeSpan.FromTicks
has the following syntax.
public static TimeSpan FromTicks(
long value
)
Parameters
TimeSpan.FromTicks
has the following parameters.
value
- A number of ticks that represent a time.
Returns
TimeSpan.FromTicks
method returns An object that represents value.
Example
The following example creates several TimeSpan objects using the FromTicks method.
using System;//from w ww .j ava 2 s . com
class MainClass
{
static void Main( )
{
TimeSpan interval = TimeSpan.FromTicks( 6 );
string timeInterval = interval.ToString( );
Console.WriteLine( timeInterval );
}
}
The code above generates the following result.