Skip to main content

Timer

The Timer widget is a time display widget that counts down from a set time, or counts elapsed time up, and shows the result on screen.
Use it for time limits, stopwatches, event end notices, and similar cases.

Definition and role

The Timer widget draws the time as text in the format you set, such as mm:ss. Countdown mode counts down from a given time to zero, and count-up mode counts up from zero. Start, stop, and reset the timer from a script, and run an expiry action when a countdown reaches 00:00.

  • Category: Contents
  • Default mode: countdown (countDown)
  • Default display format: mm:ss
  • Default countdown time: 60 seconds (60000ms)
  • Default update interval: 1 second (1000ms)

Features

FeatureDescription
Countdown / count-upCounts down from the set time or up from zero, depending on the mode.
Time format displayDisplays the time as hh:mm:ss, mm:ss, ss, or a format that includes milliseconds.
Script controlStart, stop, and reset the timer and check whether it is running, all from a script.
Expiry eventRuns the action connected to onExpired when a countdown reaches 00:00.

How to use

  1. Open the Contents category in the left widget palette.
  2. Drag and drop the Timer item onto the canvas.
  3. In the properties panel on the right, set the mode (timerType) and the display format (timeFormat).
  4. In countdown mode, set the time limit with countdownTimeMs.
  5. If you need to, connect an action to onExpired to run on expiry, and call start(), stop(), and reset() from a script.

Properties

PropertyDescriptionDefaultValue / Type
timerTypeTimer mode (countdown or count-up)countDowncountDown, countUp
timeFormatTime display formatmmsshhmmss, mmss, ss, hhmmssMs, mmssMs, ssMs
countdownTimeMsCountdown start time, in milliseconds60000 (60 seconds)Number (ms)
updateIntervalMsScreen update interval, in milliseconds1000 (1 second)Number (ms)
styleText style, such as color and sizeDefault style (not set)Text style

Notes and tips

warning

onExpired fires in countdown mode only. Count-up mode keeps increasing with no upper bound, so it has no expiry event.

tip

In edit (design) mode the timer does not actually run — it only previews the start value. Time passes once you call start() on the running screen. Also, if updateIntervalMs is 0 or less, the timer runs on the default 1-second (1000ms) interval.

Learn more

tip

For the full set of Widget Control (Property, Method, and Event) you can use to script this widget, see Timer Widget Control.