Benchmarking Sections of Code in LabVIEW

Updated Jun 6, 2018

Reported In

Software

  • LabVIEW

Issue Details

I have a program in LabVIEW that uses a while loop, and I want to know how long it takes for my while loop to iterate. I am acquiring data that is continuously changing, but there is a delay between when the data changes and when I see this update in my program. How can I tell if my while loop is causing this delay? How can I benchmark my while loop?

Solution

You can benchmark how long it takes to iterate through a while loop by using the Tick Count (ms) VI. 

This takes the current time in milliseconds and subtracts it from the time during the previous iteration, which is saved in the shift register. 

You can code an alternate version that uses a Feedback Note instead of Shift Registers. You just need to drop the following code inside your while loop and get the Iteration time (ms) without any modification to your original code.

Additional Information

If your while loop is taking a significant amount of time to execute each iteration, you may want to consider using multiple while loops. Implementing a producer/consumer architecture can help reduce the time it takes to iterate through each while loop, and prevent data loss. 

WAS THIS ARTICLE HELPFUL?

Not Helpful