GetTimerRemainingTime: Difference between revisions

From Onset Developer Wiki
Created page with "{{Info|Function|Server|1.0}} {{FuncDescription|__EDIT_ME__}} {{FuncSyntax|GetTimerRemainingTime(timer)}} {{FuncParameters}} {{FuncParam|timer|__EDIT_ME__}} {{FuncReturnVal..."
 
28days (talk | contribs)
No edit summary
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Info|Function|Server|1.0}}
{{Info|Function|Server & Client|1.0}}


{{FuncDescription|__EDIT_ME__}}
{{FuncDescription|Gets the specified timer's remaining time.}}


{{FuncSyntax|GetTimerRemainingTime(timer)}}
{{FuncSyntax|GetTimerRemainingTime(timer)}}


{{FuncParameters}}
{{FuncParameters}}
{{FuncParam|timer|__EDIT_ME__}}
{{FuncParam|timer|The timer identifier}}


{{FuncReturnValue|__EDIT_ME__}}
{{FuncReturnValue|The '''float''' value of timer interval left.}}


== Example ==
== Example ==
__EDIT_ME__
<syntaxhighlight lang="Lua">
local timerId = CreateTimer(function ()
    print("Timer called.")
end, 5 * 1000)
 
Delay(1000, function ()
    print(GetTimerRemainingTime(timerId))
end)
</syntaxhighlight>


{{RelatedFunctions}}
{{RelatedFunctions}}
__EDIT_ME__
{{Template:TimerFunctions}}

Latest revision as of 13:53, 22 February 2020

GetTimerRemainingTime

Type: Function
Context: Server & Client
Introduced: v1.0

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)

See also