Skip to content
DizzasTeR edited this page Nov 1, 2020 · 4 revisions

create

Creates a timer

Timer Timer.create(function callback, int interval, int repeat [, ...optionalParameters])

Parameters

  • function callback — A handler function to be called
  • int interval — Timer interval in miliseconds (Minimum interval allowed is 50ms)
  • int repeat — How many times should the timer repeat or -1 to repeat indefinitely

Returns

Instance - Timer instance/object if the timer was created successfully, nil if something went wrong.

Example

Timer.create(function(myNun, myMsg)
    Logger.info("["..myNum.."] -> "..myMsg) 
end, 1000, 1, 100, "My Message")

Clone this wiki locally