Timer

Creates an alert that is triggered by a time-related event. For example, before closing a page after a specified time interval has elapsed.

In an implementation where the timer has a boundary event attached to it and ends with a stay-on-page event, the timer can also be activated upon reaching the stay-on-page event after the boundary event is emitted.

Configuration properties

Under Configuration, set or modify the configuration properties for the view.

The configuration properties for Timer are listed in the following table:
Table 1. Configuration properties for Timer
Configuration property Description Data type
Timeout value (ms) Specifies the time interval (in milliseconds) before the timer is activated. Integer
Repeatable Specifies whether the timer is triggered repeatedly for the specified timeout interval. Boolean
Initially stopped When selected, this option specifies that the timer does not start running until you specifically start it by using the start() method. Boolean

Events

Set or modify the event handlers for the view in the Events properties. You can set events to be triggered programmatically or when a user interacts with the view. For information about how to define and code events, see User-defined events.
Timer has the following types of event handlers:
  • On timeout: Activated at timeout. If set to Repeatable, this event handler is triggered multiple times. For example:
    ${CounterDisplay}.setText(me.getTicks())
  • On boundary event: Activated upon reaching a stay-on-page event after a boundary event is emitted by the Timer view. For example:
    alert("Stay on Page status '" + status + "'")
    For more information, see the context.trigger() method in the The coach view context object topic.

Methods

For detailed information on the available methods for Timer, see the Timer JavaScript API.

Additional resources

For information about how to create a coach or page, see Building coaches.
For information about standard properties (General, Configuration, Positioning, Visibility, and HTML Attributes), see View properties.