Aktualizr
C++ SOTA Client
timer.h
1 #ifndef TIMER_H_
2 #define TIMER_H_
3 
4 #include <chrono>
5 #include <iostream>
6 
7 /**
8  * Elapsed time measurement
9  */
10 class Timer {
11  public:
12  Timer();
13  Timer(const Timer&) = delete;
14  Timer& operator=(const Timer&) = delete;
15  bool RunningMoreThan(double seconds) const;
16  friend std::ostream& operator<<(std::ostream& os, const Timer& /*timer*/);
17 
18  private:
19  using Clock = std::chrono::steady_clock;
20 
21  Clock::time_point start_;
22 };
23 
24 #endif // TIMER_H_
Elapsed time measurement.
Definition: timer.h:10