gre.timer set interval

gre.timer_set_interval(
    function,
    interval
)
                    

This function creates a repeating timer which fires every "interval" milliseconds and then executes "function"

Parameters: function The function to be called when the timer fires interval The time in milliseconds of how often the timer should fire Returns: A piece of lightuserdata which serves as an identifier for the timer Example:

local idval = {}
function cb_func()
    print("CB FUNC HAS BEEN CALLED")
end

--Call cb_func every 2 seconds
function cb_set_interval()
    idval = gre.timer_set_interval(cb_func, 2000)
end
            
Was this article helpful?
1 out of 1 found this helpful