SysIo  1.9.0
Embedded Library and tools
clock.h
1 
8 #ifndef _SYSIO_CLOCK_H_
9 #define _SYSIO_CLOCK_H_
10 
11 #include <cstdint>
12 
18 namespace Sysio {
19 
31  class Clock {
32 
33  public:
40  Clock();
41 
45  virtual ~Clock();
46 
56 #ifdef __DOXYGEN__
57  static inline void sleep (unsigned long s);
58 #else
59  static inline void sleep (unsigned long s) {
60  delay (s * 1000UL);
61  }
62 #endif
63 
73  static void delay (unsigned long ms);
74 
87  static void delayMicroseconds (unsigned long us);
88 
95  unsigned long millis();
96 
103  unsigned long micros();
104 
105  private:
106  uint64_t _us;
107  uint64_t _ms;
108  };
112 }
113 
114 /* ========================================================================== */
115 #endif /*_SYSIO_CLOCK_H_ defined */
unsigned long micros()
Number of microseconds.
unsigned long millis()
Number of milliseconds.
static void sleep(unsigned long s)
Pauses for the amount of seconds.
static void delay(unsigned long ms)
Pauses for the amount of milliseconds.
virtual ~Clock()
Destructor.
static void delayMicroseconds(unsigned long us)
Pauses for the amount of microseconds.
Definition: clock.h:18
Clock()
Constructor.
Horloge.
Definition: clock.h:31