06-24-2014 08:10 AM
Hello,
What is the best way to time the period in which a FOR loop executes.
I have a piece of code in a FOR loop and it executes 500 times. Whats the best way to time the duraction of the execution?
Thanks,
Nevica
Solved! Go to Solution.
06-24-2014 08:16 AM
Do you want to measure the time? If so, this is one of the few cases where a flat sequence is of use; Place a Time(ms) in the first frame, your loop in the second and a 2nd Time in the 3rd, calculate the difference.
/Y
06-24-2014 08:35 AM
Attached is a quick example as described.
Using timing probes help as well. Generally you probe an error wire to start the timer, then probe another error wire and the probe calculates the time difference between them.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
06-24-2014 08:39 AM - edited 06-24-2014 09:07 AM
Many thanks.
I was unclear as to the best timing .vi to use.
'High resolution relative seconds.vi' is a .vi you wrote? It is password protected! It is not available on the palate so you must have written it, or someone else.
Thanks,
Nevica
06-24-2014 09:03 AM
I only attached one VI and High resolution time was not one of them so I did not write it. Looking at the help you can see the file on disk (or CTRL + I to open the documentation).
You'll see it is in the vi.lib installed with LabVIEW it just isn't on the palette. It has been added to the hidden gems package. I still don't know which timing tool to use or when. Generally I just use the Tick Count which gives a resolution of ms. In almost all situations this will be fine but there maybe cases where you want to see more digits of precision. Still there is a limit at some point. How many clock cycles does it take to read the time and return it? Heisenberg comes into play at some point.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord