31 static void startCallback(uv_timer_t *handle) {
37 using Time = std::chrono::duration<uint64_t, std::milli>;
46 return initialize(&uv_timer_init);
61 void start(Time timeout, Time repeat) {
62 invoke(&uv_timer_start,
get(), &startCallback, timeout.count(), repeat.count());
69 invoke(&uv_timer_stop,
get());
80 invoke(&uv_timer_again,
get());
102 uv_timer_set_repeat(
get(), repeat.count());
111 return Time{uv_timer_get_repeat(
get())};
Time repeat()
Gets the timer repeat value.
bool init()
Initializes the handle.
void stop()
Stops the handle.
void again()
Stops the timer and restarts it if it was repeating.
void repeat(Time repeat)
Sets the repeat interval value.
void start(Time timeout, Time repeat)
Starts the timer.