LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

While Loop vs Timed Loop

Solved!
Go to solution

Is there any difference between a Timed loop and a While loop with a wait function in it?
I tried to test the difference by running one of each loop in parallel, then checking the speed:

From what I saw, they run either exactly the same or within 1 ms of each other.

But that 1ms, if you were to look at % error would be X*10^-7 so it doesnt make much difference.


Does anyone know why someone would use one over the other?

Cory K
0 Kudos
Message 1 of 3
(2,800 Views)
Solution
Accepted by topic author Cory_K

The main difference is you normally want a timed loop in a RT OS, while a "normal" loop in Windows.

 

You can control priority/processor/etc in a timed loop.

 

But the biggest difference is the lack of multithreading in a timed-loop. (In my opinion)

Chris Van Horn
Applications Engineer
0 Kudos
Message 2 of 3
(2,796 Views)

Cory,

 

I cannot answer your question exactly but I will point out that the Timed loop is tied to one OS and is not cross platform.

 

Lynn 

Message 3 of 3
(2,795 Views)