[pascal] thistick:=environment.get_TickCount;
if thistick-lasttick>100 then begin
fps:=frames*1000/(thistick-lasttick);
label1.Text:=system.String.Format('FPS: {0}',[fps.tostring('00000000.00')]);
frames:=0;
lasttick:=environment.get_TickCount;
end;[/pascal]

try the safe way of doing it:

[pascal] thistick:=environment.get_TickCount;
if thistick-lasttick>1000 then begin
fps:=frames;
label1.Text:=system.String.Format('FPS: {0}',[fps.tostring('00000000.00')]);
frames:=0;
lasttick:=thistick;
end;[/pascal]