Added CPU sleeping for framerate cap