Class real_time_tools::Spinner¶
-
class
real_time_tools
::
Spinner
¶ Class to have threads / loops running at a desired frequency.
Public Functions
-
Spinner
()¶
-
void
set_period
(double period)¶ set_period sets the period of the loop in !!seconds!!
- Parameters
period
: in seconds.
-
void
set_frequency
(double frequency)¶ Set the frequency of the loop [Hz].
- Parameters
frequency
:
-
void
initialize
()¶ To be called at the beginning of the loop if the spinner is not created just before.
-
void
spin
()¶ spin waits for the time such that successive calls to spin will result in spin being called at the desired frequency
-
double
predict_sleeping_time
()¶ Predict the time the current thread is going to sleep.
-