Set the thread to sleep to synchronise the FPS