omni::chrono::async_timer::set_interval
NAME

omni::chrono::async_timer::set_interval

A member function of omni::chrono::async_timer

#include <omni/chrono/async_timer.hpp>
void omni::chrono::async_timer::set_interval(uint32_t interval_ms)

SYNOPSIS

Sets the timer interval.

top

DESCRIPTION

Sets the interval in between each timer tick event. This can be called after the timer has started and can lengthen or shorten when a tick is to happen. In other words, if an interval is initially set to 5 seconds, and the timer is started, then 3 seconds later the interval is set to 2 seconds, the timer will near immediately tick due to the interval being shortened.

Inversely, if a timer has been set to 5 seconds, started, and then 3 seconds later, the interval is set to 7 seconds, the timer will then fire at 7 seconds, prolonging any tick events from happening.

top

CONSIDERATIONS

Care should be take to set the interval mid-tick or mid-interval as additional tick events can happen due to the change in interval time.

top