time_data.hpp
Go to the documentation of this file.
1 
8 /*****************************************************************************
9 ** Ifdefs
10 *****************************************************************************/
11 
12 #ifndef ELC_TIME_TIME_DATA_HPP_
13 #define ELC_TIME_TIME_DATA_HPP_
14 
15 /*****************************************************************************
16 ** Includes
17 *****************************************************************************/
18 
19 #include <vector>
20 #include <ecl/config/macros.hpp>
21 #include <ecl/time/duration.hpp>
22 #include "macros.hpp"
23 
24 /*****************************************************************************
25 ** Namespaces
26 *****************************************************************************/
27 
28 namespace ecl {
29 
30 /*****************************************************************************
31 ** Interface [TimeData]
32 *****************************************************************************/
40 public:
41  /*********************
42  ** Collection
43  **********************/
49  void push_back(const ecl::Duration& duration ) { durations.push_back(duration); }
53  void clear() { durations.clear(); }
54 
55  /*********************
56  ** Statistics
57  **********************/
62  ecl::Duration average() const;
67  ecl::Duration stdDev() const;
72  ecl::Duration variance() const;
73 
74 private:
75  std::vector<ecl::Duration> durations;
76 };
77 
78 } // namespace ecl
79 
80 #endif /* ELC_TIME_TIME_DATA_HPP_ */
std::vector< ecl::Duration > durations
Definition: time_data.hpp:75
Embedded control libraries.
Device for conveniently storing and analysing benchmarking times.
Definition: time_data.hpp:39
Cross-platform header inclusions for the duration typedefs.
void push_back(const ecl::Duration &duration)
Append a new timing measurement to the sequence.
Definition: time_data.hpp:49
TimeStamp Duration
Convenience typedef to associate timestamps with the concept of durations.
Definition: duration.hpp:41
#define ecl_time_PUBLIC
Definition: macros.hpp:37
void clear()
Reset the container (i.e. clear it).
Definition: time_data.hpp:53


ecl_time
Author(s): Daniel Stonier
autogenerated on Mon Jun 10 2019 13:08:15