love.timer.getFPS

Returns the current number of frames per second.

Function

Synopsis

fps = love.timer.getFPS( )

Arguments

None.

Returns

number fps
The current FPS.

Notes

The returned value is an average of values taken over the last one second, and it is one over what love.timer.getAverageDelta returns, otherwise known as the multiplicative inverse.
To get instantaneous frame rate values, use 1/love.timer.getDelta(), or 1/dt if in love.update, with dt given as the parameter.

Examples

Display text at the top left of the screen showing the current FPS.

function love.draw()
   love.graphics.print("Current FPS: "..tostring(love.timer.getFPS( )), 10, 10)
end

See Also


Other Languages