Something along the lines of this: while (render) { immutable auto startTime = MonoTime.currTime;// Render the frame...immutable auto remain = m_frameDuration - (startTime - MonoTime.currTime);if (remain > Duration.zero) Thread.sleep(remain); }
In that case, the best thing you can do is use vsync as the waiting mechanism ;)