Future wait([double duration = 1.0]) async { var t = 0.0; while (t < duration) { var dt = await display.nextFrame(); t += dt; updateMobjects(dt); updateFrame(dt); } }