I show you an example as follows.
DIM ITV[60]:FILL ITV,0
PTR=0:PMS=MILLISEC
'START OF LOOP
ITV[PTR]=MILLISEC-PMS
PMS=MILLISEC:PTR=(PTR+1)MOD 60:TTL=0
FOR I=0 TO 59:TTL=TTL+ITV[I]:NEXT I
IF TTL!=0 THEN FPS=60/(TTL/1000) ELSE FPS=0
LOCATE 2,2:?FORMAT$("%6.1F FPS",FPS)
'END OF LOOP