Table of Contents

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

value long

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

isPacked bool

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

PackedTimeSpan32(TimeSpan)

Packs the given timeSpan.

public PackedTimeSpan32(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(PackedTimeSpan32)

Unpacks to a TimeSpan.

public static explicit operator TimeSpan(PackedTimeSpan32 packed)

Parameters

packed PackedTimeSpan32

Returns

TimeSpan