Hi ! i don't understand... when i limit the fps to 60 with this code 62 is displayed as true fps !!! What's wrong ? Thanks for the help !
Strict
Const CTE_FPS_LIMIT = 60
Function test_fps()
Local FPS_time:Float = 1000 / CTE_FPS_LIMIT
Local FPS_timer:Float = MilliSecs() + FPS_time
Local FPS_ms:Float
Local FPScurTime
Local FPScheckTime
Local CurFPS
Local fpscounter
While Not KeyDown (KEY_ESCAPE)
FPS_ms = MilliSecs()
If (FPS_ms >= FPS_timer) Then
FPS_timer = FPS_ms + FPS_time
Cls
FPScurTime = MilliSecs()
If FPScurTime > FPScheckTime Then
FPScheckTime = FPScurTime + 1000
curFPS = fpscounter
fpscounter = 0
Else
fpscounter = fpscounter + 1
End If
DrawText "FPS=" + String (CurFPS), 0,0
Flip 0
End If
Wend
End Function
Graphics 1024 , 768 , 32 , 75
test_fps()
|