1#include <xrpl/beast/clock/basic_seconds_clock.h>
2#include <xrpl/beast/utility/instrumentation.h>
15class seconds_clock_thread
26 ~seconds_clock_thread();
27 seconds_clock_thread();
39seconds_clock_thread::~seconds_clock_thread()
41 XRPL_ASSERT(thread_.
joinable(),
"beast::seconds_clock_thread::~seconds_clock_thread : thread joinable");
50seconds_clock_thread::seconds_clock_thread() : stop_{false}, tp_{Clock::now().time_since_epoch().
count()}
52 thread_ =
std::thread(&seconds_clock_thread::run,
this);
55seconds_clock_thread::Clock::time_point
56seconds_clock_thread::now()
58 return Clock::time_point{Clock::duration{tp_.load()}};
62seconds_clock_thread::run()
69 auto now = Clock::now();
70 tp_ = now.time_since_epoch().count();
71 auto const when = floor<seconds>(now) + 1s;
72 if (cv_.
wait_until(lock, when, [
this] { return stop_; }))
79basic_seconds_clock::time_point
80basic_seconds_clock::now()
82 static seconds_clock_thread clk;
std::chrono::steady_clock Clock
int run(int argc, char **argv)