os.time

Part of the Os Library built into Lua, returns the time in system seconds. os.time() is very useful in conjunction with math.randomseed(), since time will always be different each time it is used (essentially guaranteeing a unique seed value).

Examples

Assign a random number based on the time to var and print it

math.randomseed(os.time())
var = math.random()
function love.draw()
   love.graphics.print(var,5,5)
end

See Also