rippled
Loading...
Searching...
No Matches
UptimeClock.h
1#pragma once
2
3#include <atomic>
4#include <chrono>
5#include <ratio>
6#include <thread>
7
8namespace xrpl {
9
18{
19public:
20 using rep = int;
24 static constexpr bool is_steady = std::chrono::system_clock::is_steady;
25
26 explicit UptimeClock() = default;
27
28 static time_point
29 now(); // seconds since rippled program start
30
31private:
34
35 struct update_thread : private std::thread
36 {
39
41 };
42
43 static update_thread
45};
46
47} // namespace xrpl
Tracks program uptime to seconds precision.
Definition UptimeClock.h:18
static constexpr bool is_steady
Definition UptimeClock.h:24
static std::atomic< rep > now_
Definition UptimeClock.h:32
static update_thread start_clock()
static time_point now()
UptimeClock()=default
static std::atomic< bool > stop_
Definition UptimeClock.h:33
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
update_thread(update_thread &&)=default