|
Re: 1s Delay Affecting Driver Controls (FTC)
You should add a timer to each of your two parallel While loops to prevent one or the other from hogging the CPU. One loop could be starving the other loop. Add a 50ms Wait to the outer part of each While loop and that will periodically release the CPU to process other tasks.
Other than the obvious "Fire? = false" case causing a half second delay in that parallel loop, I don't see anything unusually slow in your code. Because it's parallel it shouldn't slow down the first loop.
The nested Cases aren't a problem unless something time consuming happens in one of the hidden ones. Can't see where the first Tick Count goes off to, but I don't imagine you're doing anything unusual with that either.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
Last edited by Mark McLeod : 01-04-2010 at 09:31.
|