FPS
FramesPerSecond = FPS()
 
Parameters: NONE
Returns:

    FramesPerSecond = The current numbers frame drawn this past second
 

      The FPS function returns the current number of frame redraws (sync's) that were drawn over the past second.



FACTS:


      * Note: Each call to the FPS() function performs part of the Frames Per second calculation. Therefore, you should NOT call FPS() more than once per update (per sync). As that would result in the incorrect (inflated) frames per second values being returned.




Mini Tutorial:


      This example sets the Max frames per second to 20, then displays PB's limit as well as the current FPS rate.

  
; Tell PlayBASIC to limit the program to 20 (or less)
; frame updates (syncs) per second
  
  SetFPS 20
  
; start a Do/Loop
  Do
     
   ; Clear the screen
     Cls RGB(0,0,0)
     
   ; Display the Current FPS() rate
     Print "Current FPS:"+Str$(FPS())
     
   ; Display the FPS rate you set PB to Limit your syncs to
     Print "SetFPS Value:"+Str$(GetFPS())
     
   ; Display the screen
     Sync
  Loop
  



This example would output.

  
  Current FPS:20
  SetFPS Value:20
  

 
Related Info: GetFPS | SetFPS | Timer :
 


(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com