Something like this should work (untested tho). All it does is count the number of screen updates, then store the result in a separate var at the end of each second:
Global FramesPerSec:int Global FrameCounter:int Global Start:int While Not KeyDown(KEY_ESCAPE) 'do stuff UpdateFrameCounter() DrawText "FPS: " + FramesPerSec,10,10 Flip Wend Function UpdateFrameCounter() FrameCounter:+1 If Millisecs() > Start + 1000 Start = Millisecs() FramesPerSec = FrameCounter FrameCounter = 0 EndIf End Function