3#include <xrpl/basics/chrono.h>
4#include <xrpl/beast/utility/Journal.h>
58template <
class Rep,
class Period,
class Seq>
62 XRPL_ASSERT(ledgerSeq != Seq{0},
"ripple:getNextLedgerTimeResolution : valid ledger sequence");
73 return previousResolution;
91 return previousResolution;
101template <
class Clock,
class Duration,
class Rep,
class Period>
109 closeTime += (closeResolution / 2);
122template <
class Clock,
class Duration,
class Rep,
class Period>
129 using namespace std::chrono_literals;
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
std::chrono::time_point< Clock, Duration > effCloseTime(std::chrono::time_point< Clock, Duration > closeTime, std::chrono::duration< Rep, Period > resolution, std::chrono::time_point< Clock, Duration > priorCloseTime)
Calculate the effective ledger close time.
auto constexpr increaseLedgerTimeResolutionEvery
How often we increase the close time resolution (in numbers of ledgers)
std::chrono::seconds constexpr ledgerPossibleTimeResolutions[]
Possible ledger close time resolutions.
auto constexpr ledgerDefaultTimeResolution
Initial resolution of ledger close time.
std::chrono::duration< Rep, Period > getNextLedgerTimeResolution(std::chrono::duration< Rep, Period > previousResolution, bool previousAgree, Seq ledgerSeq)
Calculates the close time resolution for the specified ledger.
std::chrono::time_point< Clock, Duration > roundCloseTime(std::chrono::time_point< Clock, Duration > closeTime, std::chrono::duration< Rep, Period > closeResolution)
Calculates the close time for a ledger, given a close time resolution.
auto constexpr ledgerGenesisTimeResolution
Close time resolution in genesis ledger.
auto constexpr decreaseLedgerTimeResolutionEvery
How often we decrease the close time resolution (in numbers of ledgers)
T time_since_epoch(T... args)