timer.resume()

Type Function
Library timer.*
Return value Number
Revision 2017.3178
Keywords timer, resume, pause
See also timer.pause()
timer.performWithDelay()

Overview

Resumes a timer that was paused with timer.pause(). It returns a number that represents the amount of time remaining in the timer.

Syntax

timer.resume( timerId )
timerId (required)

Object. The timer ID from timer.performWithDelay().

Example

local function listener( event )
    print( "listener called" )
end
 
timer1 = timer.performWithDelay( 2000, listener )  -- wait 2 seconds

-- sometime later...
local pauseTime = timer.pause( timer1 )
print( "Time remaining is " .. pauseTime )

-- sometime later...
local resumeTime = timer.resume( timer1 )
print( "Resume time is " .. resumeTime )