04-26-2019 04:26 PM - edited 04-26-2019 04:29 PM
Consider the simple code below:
If I look at the time difference between loops it is always around 20, maybe 19 or 21.
Why is that?
What am I missing, it should be something simple.
mcduff
EDIT: I think now it is always executing at time 0 in the loop, then always 20 ms, not sure why I thought there was delay. Still spot on with high resolution seconds.
Need some sleep. 🙂
Solved! Go to Solution.
04-26-2019 04:40 PM
Another way to think of this is "If there's no reason to wait, do it now!" [This is something my dad always used to say to me, particularly when there was a chore to do ...].
Bob Schor
04-26-2019 06:19 PM
Your code cannot tell anything about execution order within the loop diagram, just the time between successive iterations. That time depends on the slowest function, i.e. the wait in your case. The ms resolution of the ticker is very course compared to anything else. You can substitute "high resolution relative seconds" instead, giving you better units and more resolution.