The Timer API is used to create, start, stop and check the existence of timers. ## Enabling the API This API is part of the `coreapi` extension that is included automatically. :::ruby extensions: ["coreapi"] WM, CE, Android, WP8, iOS, Win32 Create timer object(s). timer interval in ms Start timer with preset interval. Callback fired one time only. Stop the timer. Return alive state of a timer. If callback doesn't return true, returns false. 5.1.0
Implementation of the timer API. // Create a timer and catch callback after the specified interval: var timerCallback = function() { alert("callback called"); } var timer = Rho.Timer.create(); timer.start(5000, timerCallback); Create a timer, start and stop: var timerCallback = function() { alert("callback called"); } var timer = Rho.Timer.create(); timer.start(5000, timerCallback); setTimeout(function() { timer.stop(); },3000);