Apollo
6.0
Open source self driving car software
|
Used to perform oneshot or periodic timing tasks. More...
#include <timer.h>
Public Member Functions | |
Timer () | |
Timer (TimerOption opt) | |
Construct a new Timer object. More... | |
Timer (uint32_t period, std::function< void()> callback, bool oneshot) | |
Construct a new Timer object. More... | |
~Timer () | |
void | SetTimerOption (TimerOption opt) |
Set the Timer Option object. More... | |
void | Start () |
Start the timer. More... | |
void | Stop () |
Stop the timer. More... | |
Used to perform oneshot or periodic timing tasks.
apollo::cyber::Timer::Timer | ( | ) |
|
explicit |
apollo::cyber::Timer::Timer | ( | uint32_t | period, |
std::function< void()> | callback, | ||
bool | oneshot | ||
) |
Construct a new Timer object.
period | The period of the timer, unit is ms |
callback | The tasks that the timer needs to perform |
oneshot | True: perform the callback only after the first timing cycle False: perform the callback every timed period |
apollo::cyber::Timer::~Timer | ( | ) |
void apollo::cyber::Timer::SetTimerOption | ( | TimerOption | opt | ) |
Set the Timer Option object.
opt | The timer option will be set |
void apollo::cyber::Timer::Start | ( | ) |
Start the timer.
void apollo::cyber::Timer::Stop | ( | ) |
Stop the timer.