There are a couple ways to do this.

Each frame, calculate the time (in seconds) it has been since the last frame. Divide 1 by that number, and that's your momentary fps.

Do a similar...