Kagome
Polkadot Runtime Engine in C++17
clock.hpp
Go to the documentation of this file.
1 
6 #ifndef KAGOME_CLOCK_HPP
7 #define KAGOME_CLOCK_HPP
8 
9 #include <chrono>
10 
11 namespace kagome::clock {
12 
17  template <typename ClockType>
18  class Clock {
19  public:
23  using Duration = typename ClockType::duration;
27  using TimePoint = typename ClockType::time_point;
28 
29  virtual ~Clock() = default;
30 
34  virtual TimePoint now() const = 0;
35 
40  virtual uint64_t nowUint64() const = 0;
41 
42  static TimePoint zero() {
43  return TimePoint{};
44  }
45  };
46 
52 
58 
59 } // namespace kagome::clock
60 
61 #endif // KAGOME_CLOCK_HPP
static TimePoint zero()
Definition: clock.hpp:42
virtual ~Clock()=default
typename ClockType::duration Duration
Definition: clock.hpp:23
virtual uint64_t nowUint64() const =0
typename ClockType::time_point TimePoint
Definition: clock.hpp:27
virtual TimePoint now() const =0