EEROS  0.4.1.0
API for the EEROS Real-Time Robotics Framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
PeriodicCounter.hpp
Go to the documentation of this file.
1 #ifndef ORG_EEROS_CORE_PERIODICCOUNTER_HPP_
2 #define ORG_EEROS_CORE_PERIODICCOUNTER_HPP_
3 
7 #include <chrono>
8 
9 namespace eeros {
10 
12  using clk = std::chrono::high_resolution_clock;
13  using time_point = clk::time_point;
14 
15  public:
16  PeriodicCounter(double period, unsigned logger_category = 0);
17 
18  void tick();
19  void tock();
20  void reset();
21 
25 
26  private:
27  double counter_period, max_period, min_period;
28  double max_jitter, min_jitter;
29  double max_run, min_run;
30  int warn_counter, rate_limiter;
31  time_point start;
32  time_point last;
34  };
35 };
36 
37 #endif // ORG_EEROS_CORE_PERIODICCOUNTER_HPP_
void tock()
Definition: PeriodicCounter.cpp:20
Definition: PeriodicCounter.hpp:11
Statistics jitter
Definition: PeriodicCounter.hpp:23
Definition: Statistics.hpp:6
void reset()
Definition: PeriodicCounter.cpp:61
PeriodicCounter(double period, unsigned logger_category=0)
Definition: PeriodicCounter.cpp:4
Statistics run
Definition: PeriodicCounter.hpp:24
Statistics period
Definition: PeriodicCounter.hpp:22
void tick()
Definition: PeriodicCounter.cpp:15