On Thursday, 14 December 2017 at 23:45:18 UTC, Ivan Trombley wrote:
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 ;)

Reply via email to