Struct Timer

Struct Documentation

struct sixtyfps::Timer

A Timer that can call a callback at repeated interval

Use the static single_shot function to make a single shot timer

Public Functions

template<typename F>
inline Timer(std::chrono::milliseconds duration, F callback)

Construct a timer which will repeat the callback every duration milliseconds until the destructor of the timer is called.

Timer(const Timer&) = delete
Timer &operator=(const Timer&) = delete
inline ~Timer()

Public Static Functions

template<typename F>
static inline void single_shot(std::chrono::milliseconds duration, F callback)

Call the callback after the given duration.