Help please with timer to pause/resume on tap screen

So i have this question, i have a countDown clock that i want to pause when i tap the screen (it is working now as the code shown below)… But i dont know how to resume the clock if i tap again the screen (where or how do i use the timer.resume()). Thank you very much for any help or guide to the right direction

[code] local gametime = timer.performWithDelay(5000, countDown, 60)
local result = nil

local myListener = function(event)

if (result==nil) then
result = timer.pause(gametime)
end

end
Runtime:addEventListener( “tap”, myListener )[/code] [import]uid: 133258 topic_id: 24267 reply_id: 324267[/import]

Something like :

[code]
local gametime = timer.performWithDelay(5000, countDown, 60)
local taps = 1

local myListener = function(event)
taps = 1 - taps

if taps == 0 then
timer.pause(gametime)
elseif taps == 1 then
timer.resume(gametime)
end
end

Runtime:addEventListener( “tap”, myListener ) [import]uid: 84637 topic_id: 24267 reply_id: 98099[/import]