GetFPS
FramesPerSecond = GetFPS()
 
Parameters: NONE
Returns:

    FramesPerSecond = The Maximum Frames Per Second Value
 

      The GetFPS function returns the maximum number of frame redraws (sync's) that can be drawn per second.



FACTS:


      * A Setting the Maximum FPS rate to 0, means PlayBASIC is allowed to sync as fast as it possibly can.




Mini Tutorial:


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

  
; set PB 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: FPS | SetFPS | Sync | Timer :
 


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