How can I restrict the fps of my game?

Hi. I have been trying to restrict the fps of my game. So, if some heavy processing takes place, the game should cut some other computation in order to maintain the fps.

I can`t think of a way to approach it. Any help would be greatly appreciated.

Thanks in advance.