You need four variables:

Fps;
LastFps;
CurrentTime;
LastTime;

1) At the beginning, set Fps and LastFps to 0
2) At the beginning, set LastTime to CurrentTime
3) At each loop, incease Fps by 1.
4) When CurrentTime (which is updated at each loop) is greater than LastTime + 1 sec, set LastFps to Fps, Fps to 0 and LastTime to CurrentTime.
5) The variable LastFps now contains your Fps.
6) Repeat from 3)