The current version of the spinner class 1 can have a slight time drift between ticks. That means, if you setup 1000 hz frequency and you call the spinner 1000 times, then you might need significantly more than 1 seconds.
This is problematic as it means we might not getting stable 1 kHz loop when using dynamic graph manager (which uses the spinner classs).
The drift happens because Timer::get_current_time_sec() is not necessarly directly after Timer::sleep_until_sec. Also, Timer::sleep_until_sec might take a bit longer than desired.
Proposal is to fix the current implementation and avoid the drift.
The current version of the spinner class 1 can have a slight time drift between ticks. That means, if you setup 1000 hz frequency and you call the spinner 1000 times, then you might need significantly more than 1 seconds.
This is problematic as it means we might not getting stable 1 kHz loop when using dynamic graph manager (which uses the spinner classs).
The current implementation looks like this
The drift happens because
Timer::get_current_time_sec()
is not necessarly directly afterTimer::sleep_until_sec
. Also,Timer::sleep_until_sec
might take a bit longer than desired.Proposal is to fix the current implementation and avoid the drift.
inputs? @vincentberenz @MaximilienNaveau @righetti @mwuethri @luator