model.getTimer¶
since 1.1.0
Return a timer by name or by index.
Parameters¶
| Name | Type | Required | Description |
|---|---|---|---|
Name |
string | yes | or Index (integer) |
Returns¶
timer
Examples¶
local t = model.getTimer(0) -- first timer (or by name: model.getTimer("Flight"))
if t then
print(t:name(), t:stringValue(), t:running())
if not t:running() then t:reset() end
end
Returns nil when the timer doesn't exist. See the timer recipe.
From the official Ethos documentation
local timer = model.getTimer("Test")
local timer = model.getTimer(0)