Timer::afterMillis()
Checks if the specified number of milliseconds has passed since the method was first called.
Examples
import org.openpatch.scratch.*;
import org.openpatch.scratch.Timer;
public class TimerAfterMillis {
public TimerAfterMillis() {
Stage myStage = new Stage(600, 240);
Timer myTimer = new Timer();
while (true) {
myStage.display("Waiting...");
if (myTimer.afterMillis(3000)) {
break;
}
}
myStage.exit();
}
public static void main(String[] args) {
new TimerAfterMillis();
}
}
Syntax
Java
.afterMillis(millis)
Parameters
| Name | Data Type | Description |
|---|---|---|
| millis | int | the number of milliseconds to check against |
Return
boolean