pseudo code
Code:
public class myCounterCommand extends CommandBase {
double myCounter;
protected void initialize() {
myCounter = 0;
}
....
....
....
protected void execute() {
myCounter = myCounter + 10;
wait(1000);
}
or do I
Code:
...
...
protected void execute() {
while(true){
myCounter = myCounter + 10;
wait(1000);
}
}
here since the first called execute is not done will sequential calls be skipped?
here what happens the 49 times this execute is called when the wait is not done?
or do I
Code:
double lastScan,thisScan:
...
...
protected void execute() {
thisScan = *some clock value;
if(thisScan < lastScan + 1000){
myCounter = myCounter + 10;
lastScan = thisScan;
}
}
Seems then we can only safely calculate with time values Greater than 20ms and could be of by +19ms