Help make monitoring fps.
I do not like something does not work, help
Set Display Mode 1280, 1024, 32:backdrop on:Sync On:Sync Rate 0
D3D_Init:D3D_Font 1,"Arial",15,0,0,1
color backdrop rgb(10,10,10):Randomize Timer():Hide Mouse
For i=1 To 300
Make Object sphere i, Rnd(50+10),140,140
Position Object i,2000-Rnd(2000), 2000-Rnd(2000), 2000-Rnd(200)
Next i
dim fps(200) as integer
sr#=1
nn#=1
max#=0
min#=0
position camera 0,0,0,0
Do
yRotate Camera 0,a#:a#=a#+1:if a#=>360 then a#=0
`======================================================================
a2FillBox 0,0,200,100,RGB(0,0,128)
a2Box 0,0,200,100,RGB(255,255,255)
hh=hh+1
if hh=>1
fps(1)=int(screen fps())
hh=0
for i=200 to 1 step -1
fps(i)=fps(i-1)
next i
endif
`======================================================================
fps(1)=fps(2)
`Сглаживание
` sCurrent#=0
`sPrevious#=0
`sPercentage#=30
` For i = 1+1 To 200
` sPrevious# = fps(i - 1)
` sCurrent# = fps(i)
` If sCurrent# > sPrevious# * (100 + sPercentage#) / 100 Then fps(i) = (sCurrent# + sPrevious#) / 2
` Next i
max# = fps(1)
min# = fps(1)
For i = 1 To 200
If fps(i) > max# Then max# = fps(i) `находим макс. значения
If fps(i) < min# Then min# = fps(i) ` находим мин. значения
Next i
for i=1 to 200
if fps(i)=>max# then fps(i)=max#:goto a1
if fps(i)<=min# then fps(i)=min#:goto a1
fps(i)=(fps(i)*100)/max#
a1:
next i
for i=1 to 200
a2Dot i,fps(i),RGB(255,87,192)
next i
`======================================================================
Text 220, 35,str$(nn#)
for i=1 to 50
Text 590, i*12,str$(i) + "=" + str$(fps(i))
next i
Text 220, 0,str$(fps(200))
Text 220, 12,str$(fps(1))
Text 320, 30,"Max="+str$(max#)
Text 320, 42,"Min="+str$(min#)
Text 10, 10, "Fps: "+Str$(Screen Fps())
Sync
Loop