timer.hpp
1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
* Copyright (c) 2015-2016, Arkadiusz Materek (arekmat@poczta.fm)
*
* Licensed under GNU General Public License 3.0 or later.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
#ifndef XMC_DALI_TIMER_H_
#define XMC_DALI_TIMER_H_
#include <dali/dali.hpp>
namespace dali {
namespace xmc {
class Timer: public dali::ITimer {
public:
static Timer* getInstance();
uint64_t getTime() override {
return getTimeMs();
}
dali::Status schedule(ITimerTask* task, uint32_t delay, uint32_t period) override;
void cancel(ITimerTask* task) override;
uint32_t randomize() override;
static uint64_t getTimeMs();
static uint16_t freq();
static void runSlice();
private:
Timer();
Timer(const Timer& other) = delete;
Timer& operator=(const Timer&) = delete;
~Timer();
};
} // namespace xmc
} // namespace dali
#endif // XMC_DALI_TIMER_H_