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"] ## JavaScript Usage Be sure to review the [JavaScript API Usage](/guide/api_js) guide for important information about using this API in JavaScript. ## Ruby Usage Be sure to review the [Ruby API Usage](/guide/api_ruby) guide for important information about using this API in Ruby. WM, CE, Android, UWP, 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);