WoW:API GetFramerate: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
mNo edit summary
m (Move page script moved page API GetFramerate to API GetFramerate without leaving a redirect)
 
(4 intermediate revisions by 4 users not shown)
Line 1: Line 1:
<center>'''GetFramerate''' '' - Documentation by Anti-Gremlin-''</center>
{{wowapi}}
Retrieve the current framerate (frames / second).


Retrieve the current Framerate (FPS)
local framerate = GetFramerate();
 
framerate = GetFramerate();


----
----
Line 13: Line 12:
;''Returns''
;''Returns''


:;freamrate : The current frames per second.
:;framerate : Float - The current framerate in frames per second.
----
----
;''Example''
;''Example''
  -- Get the FrameRate from the Client<br />
   local framerate = GetFramerate();
   local framerate = GetFramerate();<br />
   message("Your current FPS is " .. floor(framerate) .. "fps.");
   if(framerate >= 30) then<br />
    message( "Great FPS!" );<br />
  elseif( framerate < 30 and framerate > 10 ) then<br />
    message( "Average FPS..." );<br />
  elseif( framerate <= 10 ) then<br />
    message( "Bad FPS!!!!" );<br />
  end
 
;''Result''
;''Result''


Message box appears with what kind of FPS you have.
Displays the current framerate in a message box.


----
----
;''Description''
;''Description''


: Retrieve the current framerate of your system
: Returns the current framerate.
 
 
: You can also see the same framerate in the WorldFrame with the keybind, Toggle Framerate Display (usually Control - R) where the FPS indicator can appear in the bottom-middle of the screen. You can also see the same framerate in the tooltip of the GameMenu button on the main actionbar.


----
 
{{Template:WoW API}}
: Notice the framerate displayed here adjusts slowly when the FPS quickly drops from 60 to 6, for example. If the FPS drops very fast, this function will be decreasing to 40, 20, 15, etc, for the next couple seconds until it reaches 6. This delay means it is not as accurate as third party FPS programs, but still functional. Alternatively, no delay is seen when the FPS is increased quickly.
[[Category:API Functions|GetFramerate]]
[[Category:API Core Functions|GetFramerate]]

Latest revision as of 04:45, 15 August 2023

WoW API < GetFramerate

Retrieve the current framerate (frames / second).

local framerate = GetFramerate();

Arguments
none

Returns
framerate
Float - The current framerate in frames per second.

Example
 local framerate = GetFramerate();
 message("Your current FPS is " .. floor(framerate) .. "fps.");
Result

Displays the current framerate in a message box.


Description
Returns the current framerate.


You can also see the same framerate in the WorldFrame with the keybind, Toggle Framerate Display (usually Control - R) where the FPS indicator can appear in the bottom-middle of the screen. You can also see the same framerate in the tooltip of the GameMenu button on the main actionbar.


Notice the framerate displayed here adjusts slowly when the FPS quickly drops from 60 to 6, for example. If the FPS drops very fast, this function will be decreasing to 40, 20, 15, etc, for the next couple seconds until it reaches 6. This delay means it is not as accurate as third party FPS programs, but still functional. Alternatively, no delay is seen when the FPS is increased quickly.