From the course: Learning LabVIEW

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Loop timing

Loop timing - LabVIEW Tutorial

From the course: Learning LabVIEW

Start my 1-month free trial

Loop timing

- [Instructor] When you put code inside of a for loop or while loop, LabVIEW will execute that loop's code over and over as quickly as possible. If I run this example program that generates random numbers in a while loop, you can see the generated numbers flying by. As soon as LabVIEW finishes executing the loop code, it checks for the stop condition and then immediately starts the loop over again. Allowing a while loop to run freely like this can potentially have negative impacts on the program's performance because that constantly busy loop will hog CPU resources on one of the computer's processors. If I press control+shift+escape to open the task manager and then go to the performance tab, I can see that this computer has 24 processors and the CPU usage is staying at around six or seven percent because the while loop is fully using once of those 24 processors. If I stop this program, and then go back to the task…

Contents