Checking timing of routines

You should check your graphics card settings. Is it set to sync with the vertical refresh? Perhaps provide a screenshot of that control panel for clarity.