Table of Contents

Struct Duration

Namespace
Eon
Assembly
Eon.dll

Period of time (duration). It differs from TimeSpan in that it can never be negative

public readonly struct Duration : IEquatable<Duration>, IComparable<Duration>
Implements
Inherited Members

Constructors

Duration(TimeSpan)

Duration constructor

Fields

Zero

Zero magnitude Duration (instant)

Methods

CompareTo(Duration)
Equals(Duration)
Equals(object?)
GetAwaiter()

Exposes an awaiter from Delay(int) to allow direct await on a Duration

GetHashCode()
Random(in Duration, in Duration, int?)

Random Duration between the provided min and max Duration

ToString()

Operators

operator ==(in Duration, in Duration)

Returns true if the first Duration equals the second Duration

explicit operator TimeSpan(in Duration)

Converts a Duration to a TimeSpan

operator >(in Duration, in Duration)

Returns true if the first Duration is greater than the second Duration

operator >=(in Duration, in Duration)

Returns true if the first Duration is greater than or equal to the second Duration

implicit operator double(in Duration)

Converts a Duration to a double

implicit operator Duration(double)

Converts a double to a Duration

implicit operator Duration(TimeSpan)

Converts a TimeSpan to a Duration

operator !=(in Duration, in Duration)

Returns true if the first Duration does not equal the second Duration

operator <(in Duration, in Duration)

Returns true if the first Duration is less than the second Duration

operator <=(in Duration, in Duration)

Returns true if the first Duration is less than or equal to the second Duration