GetTimerRemainingTime: Difference between revisions
From Onset Developer Wiki
No edit summary |
No edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 11: | Line 11: | ||
== Example == | == Example == | ||
<syntaxhighlight lang="Lua"> | |||
local timerId = CreateTimer(function () | |||
print("Timer called.") | |||
end, 5 * 1000) | |||
Delay(1000, function () | |||
print(GetTimerRemainingTime(timerId)) | |||
end) | |||
</syntaxhighlight> | |||
{{RelatedFunctions}} | {{RelatedFunctions}} | ||
{{Template:TimerFunctions}} |
Latest revision as of 13:53, 22 February 2020
Description
Gets the specified timer's remaining time.
Syntax
GetTimerRemainingTime(timer)
Parameters
- timer
The timer identifier
Return Value
- The float value of timer interval left.
Example
local timerId = CreateTimer(function ()
print("Timer called.")
end, 5 * 1000)
Delay(1000, function ()
print(GetTimerRemainingTime(timerId))
end)