Function
love.timer.getTime( )
Note that this func does not get the current time! It is meant for
timing pieces of code.
Also, this func is not very precise at the moment,
since SDL's timer is used. This will change in some time in the future when modules for timers
with higher resolutions are created.
Synopsis
var = love.timer.getTime( )
Returns
number
The (approximate) time in seconds since startup.
Examples
Example 9: Timing code
function load()
t_start = love.timer.getTime()
for i=12,22 do
local f = love.graphics.newFont(love.default_font, i)
love.graphics.setFont(f)
end
t_end = love.timer.getTime()
end
function draw()
love.graphics.draw("Spent " .. (t_end-t_start) .. " seconds loading 10 fonts.", 50, 50)
end