Locking Frames Per Second to 60fps
<p>I saw this episode from Extra Credits on FPS and they mention that you should normally lock the fps to multiples of 30 because it matches up with the monitor's refresh rates and reduces artifacts. My code is running at 60fps but I'm still getting a very subtle artifacts in the movement.</p>

<p><a href="https://www.youtube.com/watch?v=zL5kOyHWI_E" rel="nofollow">https://www.youtube.com/watch?v=zL5kOyHWI_E</a></p>

<p>It's in Windows Forms so perhaps there's really nothing to be done about it.</p>

<p>My render loop looks like this:</p>

<pre><code>private void Render() {
    Update();
    if (RenderDelegate != null)
        RenderDelegate(_renderFunctions);
    var msPause = 1000 / (double)FpsLimit - _gameTime.DeltaTime;
    if (msPause &gt; 0)
        System.Threading.Thread.Sleep((int)msPause);
    _attachedSystem.NextFrame(); // Will call Invalidate();
}
</code></pre>

<p>Implemtation in the WinForms control</p>

<pre><code>protected void FormOnPaint(object sender, PaintEventArgs paintEventArgs) {
    _graphic = paintEventArgs.Graphics;
    _render();
}
void IGameMessages.DrawImage(Image image, Rectangle rect) {
    _graphic.DrawImage(image, rect);
}
void IGameMessages.NextFrame() {
    Control.Invalidate();
}
</code></pre>

<p>I'm guessing that sleeping by a dynamic value is not the preferred way because it might be like 1% out of sync with the monitor refresh rate or something? The fps output swings between 58 to 63 fps (There probably something wrong with the DeltaTime calculations too)</p>