> Whats the indepth behind introducing delays in loop execution?How does
> it improve the performance of VIs?
Other posts gave you the reasons, but for a few more details.
If you build a loop that does something simple like polling some
Booleans and you place a Wait of 1ms in the loop, then the loop will run
about 1000 iterations per second. If you put a 10ms delay, 100 times
per second. By taking the delay out of the loop, and paying attention
to the iteration count of the loop, you will find that the loop runs
somewhere around 20,000,000 times per second. In otherwords, no delay
means to run as fast as possible.
Doing the math, the overhead for checking a couple Booleans is 50
nanoseconds. Doing that 20,000,000 times per second totally consumes
the CPU, using 1sec of CPU time per second. A one ms delay, or 1000
iterations uses 50 microseconds each second, or consumes 5/1000th of a
percent, or virtually no CPU time. A ten ms delay uses even less, yet
runs faster than the monitor updates and way faster than the human eye
or human reflexes.
Greg McKaskle