MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / delay

Method delay

src/main/java/field/app/RunLoop.java:253–271  ·  view source on GitHub ↗
(Runnable p0, int ms)

Source from the content-addressed store, hash-verified

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(() -> {

Callers 7

changehooks.jsFile · 0.80
chordAtMethod · 0.80
makeNewTextEditorMethod · 0.80
enableMethod · 0.80
disableMethod · 0.80
noteMethod · 0.80

Calls 2

addMethod · 0.45
attachMethod · 0.45

Tested by

no test coverage detected