DotNext by .NET Foundation and Contributors

<PackageReference Include="DotNext" Version="5.16.1" />

 Timestamp

Represents timestamp.
public TimeSpan Elapsed { get; }

Gets precise difference between the current point in time and this timestamp.

public double ElapsedMilliseconds { get; }

Gets the total elapsed time measured by the current instance, in milliseconds.

public long ElapsedTicks { get; }

Gets the total elapsed time measured by the current instance, in timer ticks.

public bool IsEmpty { get; }

Gets a value indicating that the timestamp is zero.

public bool IsFuture { get; }

Gets a value indicating that the current timestamp represents the future point in time.

public bool IsPast { get; }

Gets a value indicating that the current timestamp represents the past point in time.

public TimeSpan Value { get; }

Gets TimeSpan representing this timestamp.

public Timestamp()

Captures the current point in time.

public Timestamp(TimeSpan ts)

Constructs timestamp from TimeSpan.

public Timestamp(TimeProvider provider)

Captures the current point in time.

public static Timestamp CompareExchange(ref Timestamp location, Timestamp value, Timestamp comparand)

Adds the specified duration to the timestamp.

Adds the specified duration to the timestamp.

Subtracts the specified duration from the timestamp.

public static bool op_Equality(Timestamp left, Timestamp right)

public static TimeSpan op_Explicit(Timestamp stamp)

Gets TimeSpan representing the given timestamp.

public static bool op_GreaterThan(Timestamp first, Timestamp second)

Determines whether the first timestamp is greater than the second.

public static bool op_GreaterThanOrEqual(Timestamp first, Timestamp second)

Determines whether the first timestamp is greater than or equal to the second.

public static bool op_Inequality(Timestamp left, Timestamp right)

public static bool op_LessThan(Timestamp first, Timestamp second)

Determines whether the first timestamp is less than the second.

public static bool op_LessThanOrEqual(Timestamp first, Timestamp second)

Determines whether the first timestamp is less than or equal to the second.

Subtracts the specified duration from the timestamp.

public static void Refresh(ref Timestamp location)

Updates the timestamp to the current point in time and prevents the processor from reordering memory operations.

public static void Refresh(ref Timestamp location, TimeProvider provider)

Updates the timestamp to the current point in time and prevents the processor from reordering memory operations.

public static Timestamp VolatileRead(ref Timestamp location)

Reads the timestamp and prevents the processor from reordering memory operations.

public static void VolatileWrite(ref Timestamp location, Timestamp newValue)

Writes the timestamp and prevents the processor from reordering memory operations.

public int CompareTo(Timestamp other)

Compares this timestamp with the given value.

public double ElapsedSince(Timestamp past)

Gets a difference between two timestamps, in milliseconds.

public double ElapsedSince(Timestamp past, TimeProvider provider)

Gets a difference between two timestamps, in milliseconds.

public bool Equals(Timestamp other)

public double GetElapsedMilliseconds(TimeProvider provider)

Gets the total elapsed time measured by the current instance, in milliseconds.

public long GetElapsedTicks(TimeProvider provider)

Gets the total elapsed time measured by the current instance, in timer ticks.

Gets precise difference between the current point in time and this timestamp.