Struct PackedTimeSpan32
- Namespace
- Typhon.Schema.Definition
- Assembly
- Typhon.Schema.Definition.dll
A 4-byte (32-bit) packed TimeSpan: the tick count shifted right by PackedShift bits, giving ~102.4 µs resolution. Durations outside [MinValue, MaxValue] are not representable.
public readonly struct PackedTimeSpan32
- Inherited Members
Constructors
PackedTimeSpan32(long, bool)
Constructs from either packed or unpacked ticks.
public PackedTimeSpan32(long value, bool isPacked)
Parameters
valuelongPacked ticks when
isPackedistrue, otherwise unpacked TimeSpan ticks.isPackedbooltrueifvalueis already packed;falseto pack it.
PackedTimeSpan32(TimeSpan)
Packs the given timeSpan.
public PackedTimeSpan32(TimeSpan timeSpan)
Parameters
Fields
MaxValue
Largest representable duration.
public static readonly TimeSpan MaxValue
Field Value
MinValue
Smallest (most negative) representable duration.
public static readonly TimeSpan MinValue
Field Value
Properties
Ticks
The unpacked TimeSpan tick count (precision PackedTickResolution).
public long Ticks { get; }
Property Value
Methods
ToString()
Formats the unpacked duration via ToString().
public override string ToString()
Returns
Operators
explicit operator TimeSpan(PackedTimeSpan32)
Unpacks to a TimeSpan.
public static explicit operator TimeSpan(PackedTimeSpan32 packed)
Parameters
packedPackedTimeSpan32