Returns an instant representing the far future, likely never to be reached.
Class Instant
#include <Instant.hpp>Examples0
Public static methods3
staticasp::time::Instantnow()
staticasp::time::InstantfarFuture()
staticasp::time::InstantfromRawNanos(asp::nums::i64nanos)
Public member functions17
asp::time::Instant&operator=()
asp::time::Instant&operator=(asp::time::Instant&&other)
asp::time::DurationdurationSince()const
Returns how much time has passed since other until this instant. If other is in the future, the duration will be zero.
asp::time::Durationelapsed()const
Returns how much time has passed since this instant. If the instant is in the future, the duration will be zero.
asp::time::Durationuntil()const
Returns how much time is left until this instant. If the instant is in the past, the duration will be zero.
std::optional<asp::time::Instant>checkedAdd()const
Adds the given duration to this instant, returning std::nullopt on overflow.
std::optional<asp::time::Instant>checkedSub()const
Subtracts the given duration from this instant, returning std::nullopt on overflow.
asp::time::DurationabsDiff()const
Returns the absolute difference between this instant and another instant.
asp::time::InstantsaturatingAdd()const
Adds the given duration to this instant, returning farFuture() on overflow.
asp::time::InstantsaturatingSub()const
Subtracts the given duration from this instant, returning Instant() on overflow.
asp::time::Instantoperator+()const
Shorthand for saturatingAdd(), adds the given duration to this instant, returning farFuture() on overflow.
asp::time::Instantoperator-()const
Shorthand for saturatingSub(), subtracts the given duration from this instant, returning Instant() on overflow.