TimeSpan.FromTicks Method (Int64)


Returns a TimeSpan that represents a specified time, where the specification is in units of ticks.

Namespace:   System
Assembly:  mscorlib (in mscorlib.dll)

static member FromTicks : 
        value:int64 -> TimeSpan


Type: System.Int64

A number of ticks that represent a time.

Return Value

Type: System.TimeSpan

An object that represents value.

This is a convenience method with the same behavior as the TimeSpan.TimeSpan(Int64) constructor. A single tick represents one hundred nanoseconds or one ten-millionth of a second. There are 10,000 ticks in a millisecond.

The following example creates several TimeSpan objects using the FromTicks method.

No code example is currently available or this language may not be supported.

Universal Windows Platform
Available since 8
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Return to top