Quote:
Originally Posted by cpapplefamily
I understand enough that long loops would be bad in this environment. Do I use waits and loops in the execute method? Then use the isFinished() command or a condition of the loop to end the code. What happens the loop was running still when the execute method is called again and again. Or do I record the time since last execute to calculate my time sensitive code? most of the documentation I read is is the execute and isFinished is called "ABOUT" 50 times / sec or every 20ms.
This is not what I'm aiming for but simply put every 1 sec i want to add 10 to double myCounter
Code:
double myCounter = 0;
while(true){
myCounter = myCounter + 10;
wait(1000); //Wait 1 sec
}
|
You would not want to put any loops or waits in the execute method and instead check the time there to see if you should add 10 to the counter.