onTimersChanged

open fun onTimersChanged(listener: () -> Unit): () -> Unit(source)

Calls listener when a script sets or clears a timer, from the thread the script runs on, and returns a function that stops the listening. A viewer pumps the timers only while one waits, so it learns here of a timer that a script set outside the viewer's own calls. The default reports nothing, and a viewer then checks hasTimers after each call it makes.