20 #include <ripple/basics/Log.h>
21 #include <ripple/core/TimeKeeper.h>
22 #include <ripple/core/impl/SNTPClock.h>
38 adjust(std::chrono::system_clock::time_point when)
40 return time_point(std::chrono::duration_cast<duration>(
41 when.time_since_epoch() -
days(10957)));
74 auto const s = amount.
count();
88 JLOG(
j_.
info()) <<
"TimeKeeper: Close time offset now "
93 JLOG(
j_.
warn()) <<
"TimeKeeper: Large close time offset = "
105 return duration_cast<chrono::duration<int32_t>>(
clock_->offset());
121 return std::make_unique<TimeKeeperImpl>(j);
static time_point adjust(std::chrono::system_clock::time_point when)
std::chrono::duration< std::int32_t > closeOffset_
time_point closeTime() const override
Returns the close time, in network time.
std::chrono::duration< std::int32_t > nowOffset() const override
std::unique_ptr< SNTPClock > make_SNTPClock(beast::Journal j)
A generic endpoint for log messages.
Manages various times used by the server.
void adjustCloseTime(std::chrono::duration< std::int32_t > amount) override
Adjust the close time.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
void run(std::vector< std::string > const &servers) override
Launch the internal thread.
std::chrono::duration< std::int32_t > closeOffset() const override
std::unique_ptr< TimeKeeper > make_TimeKeeper(beast::Journal j)
std::unique_ptr< SNTPClock > clock_
time_point now() const override
Returns the estimate of wall time, in network time.
typename NetClock ::time_point time_point
TimeKeeperImpl(beast::Journal j)