delay

Top  Previous  Next

timer.new creates a new timer object.

Delay allows you to quickly schedule the delayed execution of a lua function.

Definition

timerObj = delay.run( timeout, callback )

Name

Type

Description

timerObj

Timer Object

The underlying timer object.

timeout

number

Number of miliseconds till callback is called.

callback

function(Timer Object)

The function to call.

Example

 

delay.run(500, function(t)

  print("hello")

end)

 

 

 

This prints "hello" after 500 milliseconds.

Related

Timer Object

Availability

Lua