20 #include <ripple/basics/Log.h>
21 #include <ripple/core/TimeKeeper.h>
22 #include <ripple/core/impl/SNTPClock.h>
39 adjust (std::chrono::system_clock::time_point when)
42 std::chrono::duration_cast<duration>(
43 when.time_since_epoch() -
82 auto const s = amount.
count();
97 "TimeKeeper: Close time offset now " <<
103 "TimeKeeper: Large close time offset = " <<
115 return duration_cast<chrono::duration<int32_t>>(
clock_->offset());
131 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)