timer.every

Schedules a repeating callback.

Syntax

ue.timer.every(interval_seconds: number, callback: function) -> integer

Parameters

ParameterTypeDescription
interval_secondsnumberInterval greater than zero.
callbackfunction(id)Function called with the timer ID.

Returns

TypeDescription
integerTimer registration ID.

Example

local id = ue.timer.every(1.0, function()
    print("one second elapsed")
end)

Notes

  • A repeating timer is cancelled automatically if its callback errors.

On this page