This one is closer:
Quote:
Originally Posted by cpapplefamily
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
|
but the comparison in the if statement should be ">" or ">=", not "<".