function milliDelay()
Jump to navigation
Jump to search
Run a function after specified number of milliseconds. milliDelay() is non-blocking (following command in the script is executed immediately, before the callback function).
nil delay(numbermilliseconds
, functioncallback
)
Parameters
- number
milliseconds
how much the callback will be delayed - function
callback
function to execute
Return value
nil
Usage
-- logs counts down from 5 to 0 function countDown(from) logf("%d", from) if(from > 0) then delay(1000, function() countDown(from-1) end) end end countDown(5)
See also
- delay() to delay callback execution by seconds