04-03-2009 06:27 PM
Hi,all
could you tell me What's the difference between the function "wait(ms)" and "wait until next ms multiple"?
04-03-2009 08:05 PM
They are very different and I think it is explained well in the help. Did you read it?:
For additional discussion, see e.g. this link.
Assuming you wire a 100 to each, the following would happens:
The wait next ms multiple keeps accurate pacing between iterations of a loop, except for the first iteration which will be randomly between 0 and 100. (and the rare case where the ms timer rolls over) Even if it takes 90ms for the timer to be in the dataflow in later iterations, the loop will spin about every 100ms.
(analogy: do something every time the minutes on the digital clock are 00, i.e. at each full hour)
The wait(ms) will wait the given amount, but for example if something takes 10ms before the node is in the dataflow, the iteration may take 110ms. The wait has more chances to drift for long runs, which is of course totally irrelevant for simple polling loops.
(analogy: take a 1 hour break after every action)
If you need accurate timing, both are not that great. Use a timed loop instead, 🙂
04-04-2009 04:38 AM
altenbach
Thank you very much!