C# TimeSpan TimeSpan(Int64)

Description

TimeSpan TimeSpan(Int64) initializes a new instance of the TimeSpan structure to the specified number of ticks.

Syntax

TimeSpan.TimeSpan(Int64) has the following syntax.


public TimeSpan(
  long ticks
)

Parameters

TimeSpan.TimeSpan(Int64) has the following parameters.

  • ticks - A time period expressed in 100-nanosecond units.

Example

The following example creates TimeSpan objects using the constructor overload that initializes a TimeSpan to a specified number of ticks.


using System;/* w w w. j av  a2 s .co  m*/

class TimeSpanCtorLDemo
{
    static void Main( )
    {
        TimeSpan elapsedTime = new TimeSpan( 999999 );
    } 
} 

The code above generates the following result.





















Home »
  C# Tutorial »
    System »




Array
BitConverter
Boolean
Byte
Char
Console
ConsoleKeyInfo
Convert
DateTime
DateTimeOffset
Decimal
Double
Enum
Environment
Exception
Guid
Int16
Int32
Int64
Math
OperatingSystem
Random
SByte
Single
String
StringComparer
TimeSpan
TimeZone
TimeZoneInfo
Tuple
Tuple
Tuple
Type
UInt16
UInt32
UInt64
Uri
Version