cpuwatch_rt.hpp
Go to the documentation of this file.
1 
11 /*****************************************************************************
12 ** Ifdefs
13 *****************************************************************************/
14 
15 #ifndef ECL_TIME_CPUWATCH_POS_HPP_
16 #define ECL_TIME_CPUWATCH_POS_HPP_
17 
18 /*****************************************************************************
19 ** Platform Check
20 *****************************************************************************/
21 
22 #include <ecl/config.hpp>
23 
24 #if defined(ECL_IS_POSIX)
25  // monotonic clock, cpu clock -> clock_gettime; clock_selection -> clock_nanosleep
26  #if defined(_POSIX_MONOTONIC_CLOCK) && (_POSIX_MONOTONIC_CLOCK) >= 0L && defined(_POSIX_CLOCK_SELECTION) && (_POSIX_CLOCK_SELECTION) >= 0L
27 
28 /*****************************************************************************
29 ** Includes
30 *****************************************************************************/
31 
32 #include <ecl/config/macros.hpp>
33 #include "timestamp.hpp"
34 #include "macros.hpp"
35 
36 /*****************************************************************************
37 ** Namespaces
38 *****************************************************************************/
39 
40 namespace ecl {
41 
42 /*****************************************************************************
43 ** Classes
44 *****************************************************************************/
72 class ecl_time_PUBLIC CpuWatch
73 {
74  public:
79  CpuWatch();
80 
81  virtual ~CpuWatch() {}
88  void restart();
89 
96  TimeStamp elapsed();
103  TimeStamp split();
104 
105  private:
106  TimeStamp start_time, split_time;
107  timespec tmp; // use for temporary cacluations.
108 };
109 
110 }; // namespace ecl
111 
112 #endif /* MANY POSIX TIME REQ'MENTS */
113 #endif /* ECL_IS_POSIX */
114 #endif /* ECL_TIME_CPUWATCH_POS_HPP_ */
config.hpp
timestamp.hpp
Cross-platform header inclusions for the timestamp class.
ecl_time_PUBLIC
#define ecl_time_PUBLIC
Definition: macros.hpp:37
macros.hpp
ecl
Embedded control libraries.


ecl_time
Author(s): Daniel Stonier
autogenerated on Wed Mar 2 2022 00:16:19