Closed franckgaga closed 1 month ago
I normally use the method I outline in this video (starts at 5:00), that is, to measure the execution time of the loop and then sleep using systemsleep
for the loop interval, adjusted for the execution time. This is the method I've found to have the best predictability, at least under Linux.
For fancier scheduling there are tools like https://github.com/narijauskas/ReactiveToolkit.jl
@baggepinnen André was asking if there is any tools for (soft) real-time loops in julia. Something that could be use with this package to implement MPC on a real plant.
For sure, there is the simple polling solution with
time
in awhile
loop. Are you aware of anything fancier ? Maybe we could add simple functionalities for that ? I was thinking of using Asynchronous Programming for that, since one could say that's the high-level equivalent of an interrupt. What do you think ?