Skip to main content

Timer

Timer is a component has a setInterval event. That event calls Window setInterval and clearInterval methods to star or stop functions which are called periodically by its timer interval (in milliseconds) property.

Timer has 3 methods to call setInterval and clearInterval methods.

  • timer.start() method calls a function or evaluates an expression at specified intervals (in milliseconds). The start() method will continue calling the function until stop() is called, or the window is closed.
  • timer.stop() method clears a timer set with the start() method.
  • timer.reStart method calls timer.stop() and timer.start() respectively.

Props​

AttributeDescriptionTypeDefault
autostartDecides to start automatically Timer' setInterval event.booleanfalse
timeThe intervals (in milliseconds) on how often to execute the code.numberundefined
visibleVisibility of Timer component.booleantrue

Events​

Timer starts by setInterval event

  • setInterval: Calls a function or evaluates an expression at specified intervals (in milliseconds). The setInterval method will continue calling the function until stop() is called, or the window is closed
total = total +1
quick.EM.trace('Test Me')`**

Example usage of start, stop, restart, status methods:

qtimer