20 #ifndef RIPPLE_CORE_TIMEKEEPER_H_INCLUDED
21 #define RIPPLE_CORE_TIMEKEEPER_H_INCLUDED
23 #include <ripple/basics/chrono.h>
24 #include <ripple/beast/clock/abstract_clock.h>
37 adjust(std::chrono::system_clock::time_point when)
39 return time_point(std::chrono::duration_cast<duration>(
40 when.time_since_epoch() -
days(10957)));
91 using namespace std::chrono_literals;
95 if (by == 0s && offset == 0s)
106 return offset + ((by + 3s) / 4);
109 return offset + ((by - 3s) / 4);
111 return (offset * 3) / 4;
std::chrono::seconds closeOffset() const
T compare_exchange_strong(T... args)
time_point closeTime() const
Returns the predicted close time, in network time.
std::chrono::seconds adjustCloseTime(std::chrono::seconds by)
Adjust the close time, based on the network's view of time.
Manages various times used by the server.
time_point now() const override
Returns the current time, using the server's clock.
Abstract interface to a clock.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
virtual ~TimeKeeper()=default
std::atomic< std::chrono::seconds > closeOffset_
static constexpr time_point adjust(std::chrono::system_clock::time_point when)
typename NetClock ::time_point time_point