17#ifndef CYBER_TIMER_TIMER_H_
18#define CYBER_TIMER_TIMER_H_
90 Timer(uint32_t period, std::function<
void()> callback,
bool oneshot);
113 bool InitTimerTask();
117 std::shared_ptr<TimerTask> task_;
118 std::atomic<bool> started_ = {
false};
Used to perform oneshot or periodic timing tasks
void Stop()
Stop the timer
void SetTimerOption(TimerOption opt)
Set the Timer Option object
void Start()
Start the timer
uint32_t period
The period of the timer, unit is ms max: 512 * 64 min: 1
TimerOption()
Default constructor for initializer list
bool oneshot
True: perform the callback only after the first timing cycle False: perform the callback every timed ...
TimerOption(uint32_t period, std::function< void()> callback, bool oneshot)
Construct a new Timer Option object
std::function< void()> callback
The task that the timer needs to perform