TimeMeasure.h
Go to the documentation of this file.
1 // -*- C++ -*-
20 #ifndef COIL_TIMEMEASURE_H
21 #define COIL_TIMEMEASURE_H
22 
23 #include <vector>
24 #include <coil/TimeValue.h>
25 
26 namespace coil
27 {
28 
50  {
51  public:
63  struct Statistics
64  {
65  double max_interval;
66  double min_interval;
67  double mean_interval;
68  double std_deviation;
69  };
70 
86  TimeMeasure(int buflen = 100);
87 
103  void tick();
104 
120  void tack();
121 
142 
158  void reset();
159 
179  unsigned long int count() const;
180 
210  bool getStatistics(double &max_interval,
211  double &min_interval,
212  double &mean_interval,
213  double &stddev);
214 
235 
236  private:
237  std::vector<coil::TimeValue> m_record;
240 
241  unsigned long int m_count;
242  const unsigned long int m_countMax;
243  unsigned long long int m_cpuClock;
244 
246  };
247 }; // namespace coil
248 #endif // COIL_TIMEMEASURE_H
Structure for time statistics.
Definition: TimeMeasure.h:63
coil::TimeValue & interval()
Get a interval time.
Definition: TimeMeasure.cpp:93
unsigned long long int m_cpuClock
Definition: TimeMeasure.h:243
Statistics getStatistics()
Get statistics result.
TimeValue class.
Definition: TimeValue.h:40
void tack()
Finish time measurement for time statistics.
Definition: TimeMeasure.cpp:72
const unsigned long int m_countMax
Definition: TimeMeasure.h:242
coil::TimeValue m_interval
Definition: TimeMeasure.h:239
void reset()
Initialize for statistics related data.
unsigned long int m_count
Definition: TimeMeasure.h:241
void tick()
Begin time measurement for time statistics.
Definition: TimeMeasure.cpp:60
TimeMeasure(int buflen=100)
Constructor.
Definition: TimeMeasure.cpp:41
unsigned long int count() const
Get number of time measurement buffer.
coil::TimeValue m_begin
Definition: TimeMeasure.h:238
std::vector< coil::TimeValue > m_record
Definition: TimeMeasure.h:237
Common Object Interface Layer.


openrtm_aist
Author(s): Noriaki Ando
autogenerated on Mon Jun 10 2019 14:07:56