From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

calculating execution time

Solved!
Go to solution

I'm trying to test the execution time on a subvi before I implement it a larger design into another VI.  It's testing the time difference between using a mathscript node and the labviews native math functions.  However, I am not able to get any kind of time delay using the tick count function.

 

Attached is my code, I'm using labview 8.2

0 Kudos
Message 1 of 13
(3,760 Views)
Your code is not attached.  I'm sure the native LabVIEW functions will be much quicker.  But if the calculation is quick enough, you might not see a difference.  Try doing the calculation repeatedly with a For Loop a thousand times, or a millions times, to magnify the time of execution.
Message 2 of 13
(3,755 Views)
ooops I'm sorry, here it is attached.  I've tried running the for loop for over 10,000,000, and can see a delay in executing physically, but it will not calculate.  I can not figure out why.
Message Edited by JJJOndae on 05-23-2010 09:14 PM
0 Kudos
Message 3 of 13
(3,749 Views)

Formula execution will be far less than 1msec. 2344324786343 - 2344324786343 = 0

 

For this sort of testing you will need to call the function multiple times, start with 10,000 and keep increasing until you can see the differences.

Drop a for loop into the centre of your sequence structures.

iTm - Senior Systems Engineer
uses: LABVIEW 2012 SP1 x86 on Windows 7 x64. cFP, cRIO, PXI-RT
Message 4 of 13
(3,748 Views)
Try this instead, and yes, there is a significant difference.
iTm - Senior Systems Engineer
uses: LABVIEW 2012 SP1 x86 on Windows 7 x64. cFP, cRIO, PXI-RT
Message 5 of 13
(3,739 Views)
Thank you for the help, but could you somehow save the file in a version that will allow me to open?  I'm using 8.2 (ancient I know :D)
0 Kudos
Message 6 of 13
(3,737 Views)

Oops, My Mistake.

 

Labview applies constant folding and optimises a fair bit of this code out.

iTm - Senior Systems Engineer
uses: LABVIEW 2012 SP1 x86 on Windows 7 x64. cFP, cRIO, PXI-RT
Message 7 of 13
(3,736 Views)
Solution
Accepted by JJJOndae
lv 8.2
iTm - Senior Systems Engineer
uses: LABVIEW 2012 SP1 x86 on Windows 7 x64. cFP, cRIO, PXI-RT
Message 8 of 13
(3,734 Views)
Wow, this works absolutely perfect.  That is a genious idea what you did there, I don't think I would have ever thought of that.  And I can see now my mathscript will execute much quicker.  Thanks so much!!
0 Kudos
Message 9 of 13
(3,724 Views)
Message Edited by Dennis Knutson on 05-23-2010 09:13 PM
0 Kudos
Message 10 of 13
(3,693 Views)