// Project: test_Timer() and ResetTimer()
// Created: 2017-11-30
SetScreenResolution(1280,790)
SetDisplayAspect(1.618) // golden aspect ratio
Global gTime = 10 //Inicial 10 seconds until exit APP
ResetTimer()
do
if GetPointerPressed() then ResetTimer() // reset countdown
Print( "Tap to reset CountDown to Exit: " + str(round(abs(Timer() - gTime))) ) // show no decimals, no negative sign
Sync()
if Timer() > gTime then exit
loop
end
function Delay(seconds#) ResetTimer() repeat Sync() until Timer() >= seconds# endfunction
Setvirtualresolution(640,480) ResetTimer() AddVirtualButton(1,200,240,80) SetVirtualButtonText(1,"Reset") Repeat Print (Timer()) If GetVirtualButtonPressed(1) then ResetTimer() Sync() Until Timer()>10 End