Mark's frametweening code - 60fps or 20fps?

Blitz3D Forums/Blitz3D Programming/Mark's frametweening code - 60fps or 20fps?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.


Global framecounter_counter
Global framecounter_time
Global framecounter_framerate
Function FPS()
    Framecounter_counter=Framecounter_counter+1
    If Framecounter_time=0 Then Framecounter_time=MilliSecs()
    If Framecounter_time+1001<MilliSecs() Then
        Framecounter_framerate=Framecounter_counter
           Framecounter_counter=0
        Framecounter_time=MilliSecs()
        EndIf
       
Return framecounter_framerate
End Function



Inlude the code in your game...
Just call the fps function in the render loop to get how many real renders per second... easy.