Click or drag to resize

GoTimeSpan Structure

Implements support for GO Language formatted durations. This class is useful for integrating with GO applications.

Namespace:  Neon.Time
Assembly:  Neon.Common (in Neon.Common.dll) Version: 2.2.0
Syntax
public struct GoTimeSpan

The GoTimeSpan type exposes the following members.

Constructors
  NameDescription
Public methodGoTimeSpan(Int64)
Constructs a GoTimeSpan from nanoseconds.
Public methodGoTimeSpan(TimeSpan)
Constructs an instance from a TimeSpan.
Top
Properties
  NameDescription
Public propertyHours
Returns the hours component of the duration.
Public propertyStatic memberMaxValue
Returns the maximum possible GoTimeSpan.
Public propertyMicroseconds
Returns the microsecond component of the duration.
Public propertyMilliseconds
Returns the millisecond component of the duration.
Public propertyMinutes
Returns the minutes component of the duration.
Public propertyStatic memberMinValue
Returns the minimum possible GoTimeSpan.
Public propertyNanoseconds
Returns the nanosecond component of the duration.
Public propertySeconds
Returns the second component of the duration.
Public propertyTicks
The duration expressed as nanosecond ticks.
Public propertyTimeSpan
Returns the equivalent TimeSpan.
Public propertyTotalHours
Returns the total number of hours.
Public propertyTotalMicroseconds
Returns the total number of microseconds.
Public propertyTotalMilliseconds
Returns the total number of milliseconds.
Public propertyTotalMinutes
Returns the total number of minutes.
Public propertyTotalNanoseconds
Returns the duration as nanoseconds.
Public propertyTotalSeconds
Returns the total number of seconds.
Public propertyStatic memberZero
Returns a zero GoTimeSpan .
Top
Methods
  NameDescription
Public methodEquals
Indicates whether this instance and a specified object are equal.
(Inherited from ValueType.)
Public methodStatic memberFromHours
Returns a GoTimeSpan from hours.
Public methodStatic memberFromMicroseconds
Returns a GoTimeSpan from microseconds.
Public methodStatic memberFromMilliseconds
Returns a GoTimeSpan from milliseconds.
Public methodStatic memberFromMinutes
Returns a GoTimeSpan from minutes.
Public methodStatic memberFromNanoseconds
Returns a GoTimeSpan from nanoseconds.
Public methodStatic memberFromSeconds
Returns a GoTimeSpan from seconds.
Public methodStatic memberFromTimeSpan
Creates a GoTimeSpan from a TimeSpan.
Public methodGetHashCode
Returns the hash code for this instance.
(Inherited from ValueType.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodStatic memberParse
Parses a GoTimeSpan from a string.
Public methodToString
Renders the time span as a GO Duration compatible string.
(Overrides ValueTypeToString.)
Public methodStatic memberTryParse
Attempts to parse a GO formatted timespan.
Top
Operators
Fields
  NameDescription
Public fieldStatic memberTicksPerHour
The number of nanosecond ticks per minute.
Public fieldStatic memberTicksPerMicrosecond
The number of nanosecond ticks per micrososecond.
Public fieldStatic memberTicksPerMillisecond
The number of nanosecond ticks per millisecond.
Public fieldStatic memberTicksPerMinute
The number of nanosecond ticks per minute.
Public fieldStatic memberTicksPerSecond
The number of nanosecond ticks per second;
Top
Remarks
Note Note

GoTimeSpan measures time down 1 nanosecond resolution whereas TimeSpan's resolution is 100ns and both implementations use a signed 64-bit integer as the underlying representation. This means that GoTimeSpan can represent of maximum duration of about 290 years (positive and negative) where TimeSpan can handle about 29,000 years.

This class will throw a ArgumentOutOfRangeException when converting a TimeSpan that is beyound the capability of a GoTimeSpan.

See Also