I have a data “audioalization” (like in visualization) project that requires fairly expensive preparatory calculations (several seconds) before starting any loops. Then, I get a timing error (“thread got too far behind in time”).
My guess is that SP’s timer is already running, thus causing the error. Is there any possibility to prevent that? E.g. to reset the timer?
Here is some code that should reproduce the behaviour:
# Fake calculation to simulate expensive pre-processing for i in range(0, 10000000) x = 1 / 100.0 end live_loop :tick do sample :elec_plip, rate: 2 sleep sec_per_day end
I know that I could use
set_sched_ahead_time!, but the duration of the pre-processing is not really predictable as it depends on the amout of data.
Many thanks for any hints!