You could just create a timer and use WaitTimer. That's not an ideal way but it is certainly very easy and would keep your game's framerate capped to 40 (or whatever you set the timer to.) Why does your game HAVE to run at 40 however? With delta time the framerate varies but that doesn't matter since the delta factor scales everything in the game according to the framerate.