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()
42 thread_.
joinable(),
"beast::seconds_clock_thread::~seconds_clock_thread : thread joinable");
51seconds_clock_thread::seconds_clock_thread() : tp_{Clock::now().time_since_epoch().
count()}
53 thread_ =
std::thread(&seconds_clock_thread::run,
this);
56seconds_clock_thread::Clock::time_point
57seconds_clock_thread::now()
59 return Clock::time_point{Clock::duration{tp_.load()}};
63seconds_clock_thread::run()
70 auto now = Clock::now();
71 tp_ = now.time_since_epoch().count();
72 auto const when = floor<seconds>(now) + 1s;
73 if (cv_.
wait_until(lock, when, [
this] { return stop_; }))
80basic_seconds_clock::time_point
81basic_seconds_clock::now()
83 static seconds_clock_thread clk;
std::chrono::steady_clock Clock
int run(int argc, char **argv)