Table of Contents

Struct PackedTimeSpan48

Namespace
Typhon.Schema.Definition
Assembly
Typhon.Schema.Definition.dll

A 6-byte (48-bit) packed TimeSpan: the tick count shifted right by PackedShift bits, giving ~102.4 µs resolution over a much wider range than PackedTimeSpan32. Durations outside [MinValue, MaxValue] are not representable.

public readonly struct PackedTimeSpan48
Inherited Members

Constructors

PackedTimeSpan48(long, bool)

Constructs from either packed or unpacked ticks.

public PackedTimeSpan48(long value, bool isPacked)

Parameters

value long

Packed ticks when isPacked is true, otherwise unpacked TimeSpan ticks.

isPacked bool

true if value is already packed; false to pack it.

PackedTimeSpan48(TimeSpan)

Packs the given timeSpan.

public PackedTimeSpan48(TimeSpan timeSpan)

Parameters

timeSpan TimeSpan

The duration to pack; must be within [MinValue, MaxValue].

Fields

MaxValue

Largest representable duration.

public static readonly TimeSpan MaxValue

Field Value

TimeSpan

MinValue

Smallest (most negative) representable duration.

public static readonly TimeSpan MinValue

Field Value

TimeSpan

Properties

Ticks

The unpacked TimeSpan tick count (precision PackedTickResolution).

public long Ticks { get; }

Property Value

long

Methods

ToString()

Formats the unpacked duration via ToString().

public override string ToString()

Returns

string

Operators

explicit operator TimeSpan(PackedTimeSpan48)

Unpacks to a TimeSpan.

public static explicit operator TimeSpan(PackedTimeSpan48 packed)

Parameters

packed PackedTimeSpan48

Returns

TimeSpan