JODA  0.13.1 (59b41972)
JSON On-Demand Analysis
RecurringTimer.h
Go to the documentation of this file.
1 //
2 // Created by Nico Schäfer on 9/19/17.
3 //
4 
5 #ifndef JODA_RECURRINGTIMER_H
6 #define JODA_RECURRINGTIMER_H
7 
8 #include <chrono>
9 #include <string>
15  public:
19  void start();
20 
24  void stop();
25 
32  void log(const std::string &what, const std::string &part) const;
33 
38  double durationSeconds() const;
39 
40  protected:
41  std::chrono::time_point<std::chrono::system_clock> now();
42  std::chrono::time_point<std::chrono::system_clock> startTime;
43  std::chrono::duration<long long, std::micro> totalDur{};
44 };
45 
46 #endif // JODA_RECURRINGTIMER_H
Definition: RecurringTimer.h:14
void stop()
Definition: RecurringTimer.cpp:16
void start()
Definition: RecurringTimer.cpp:11
std::chrono::duration< long long, std::micro > totalDur
Definition: RecurringTimer.h:43
double durationSeconds() const
Definition: RecurringTimer.cpp:36
void log(const std::string &what, const std::string &part) const
Definition: RecurringTimer.cpp:21
std::chrono::time_point< std::chrono::system_clock > now()
Definition: RecurringTimer.cpp:8
std::chrono::time_point< std::chrono::system_clock > startTime
Definition: RecurringTimer.h:42