As stated in title.
I want to have a certain interval time for each loop, say 60 seconds.
My problem is I have a code inside a loop to perform measurement with a external device.
This measurement takes 5-10 seconds.
So I cannot simply use pause(60) inside the loop because the interval time depends on how long each measurement takes.
Is there any way to fix the time interval of loop?
Sounds like you’d be able to use parallel threading to achieve what you want. One thread kicks off the measurement every sixty seconds, using a worker thread so that the measurement doesn’t block up the time interval.
Perhaps try the
batchfunction with something like this:Better would be to use the
timerfunction: