System
system
library allows to operate with UCM module directly, by receiving current uptime and delaying script execution.
note
system
library is supported since Lua API version 1.1.
system.uptime
function system.uptime()
end
Returns current UCM uptime, in seconds.
system.delay
-- @param delay number
function system.delay(delay)
end
Delays script execution for a specified delay
, in milliseconds. By default 1000
milliseconds (1 second) delay
is used. Maximum delay is 5000
milliseconds (5 seconds).
Example
-- Log current UCM uptime.
enpapter.log("Current UCM uptime is: " .. tostring(system.uptime()))
-- Delay script execution for 100 milliseconds.
system.delay(100)
-- Delay script execution with a default timeout.
system.delay()