Алгоритм отображение FPS:
var lastSavedTime,n,kolvofps:integer;
Procedure fps;
begin
n:=n+1;
if ((lastSavedTime-getRelativeTimeMs) < -1000) or (getRelativeTimeMs < lastSavedTime) then
begin
kolvofps:=n;
lastSavedTime:=getRelativeTimeMs;
n:=0;
end;
SetColor(255, 255, 255);
drawtext(integertostring(kolvofps),2,2);
repaint;
end;