(Runnable p0, int ms)
| 251 | |
| 252 | public void delay(Runnable p0, int ms) { |
| 253 | long now = System.currentTimeMillis(); |
| 254 | |
| 255 | serviceVector.add(() -> { |
| 256 | mainLoop.attach(new Scene.Perform() { |
| 257 | int t = 0; |
| 258 | |
| 259 | @Override |
| 260 | public boolean perform(int pass) { |
| 261 | if (System.currentTimeMillis() - now > ms) { |
| 262 | p0.run(); |
| 263 | return false; |
| 264 | } |
| 265 | return true; |
| 266 | } |
| 267 | |
| 268 | }); |
| 269 | }); |
| 270 | } |
| 271 | |
| 272 | public void delayUntil(Runnable p0, long when) { |
| 273 | |
| 274 | serviceVector.add(() -> { |
no test coverage detected