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
(2,022 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
(2,017 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
(2,011 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
(2,010 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
(2,001 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
(1,999 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
(1,998 Views)
Solution
Accepted by topic author 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
(1,996 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
(1,986 Views)
Message Edited by Dennis Knutson on 05-23-2010 09:13 PM
0 Kudos
Message 10 of 13
(1,955 Views)