vispy.app.timer module

class vispy.app.timer.Timer(interval='auto', connect=None, iterations=- 1, start=False, app=None)[source]

Bases: object

Timer used to schedule events in the future or on a repeating schedule

Parameters
intervalfloat | ‘auto’

Time between events in seconds. The default is ‘auto’, which attempts to find the interval that matches the refresh rate of the current monitor. Currently this is simply 1/60.

connectfunction | None

The function to call.

iterationsint

Number of iterations. Can be -1 for infinite.

startbool

Whether to start the timer.

appinstance of vispy.app.Application

The application to attach the timer to.

property app

The vispy Application instance on which this Timer is based.

connect(callback)[source]

Alias for self.events.timeout.connect()

disconnect(callback=None)[source]

Alias for self.events.timeout.disconnect()

property elapsed
property interval
property native

The native timer on which this Timer is based.

property running
start(interval=None, iterations=None)[source]

Start the timer.

A timeout event will be generated every interval seconds. If interval is None, then self.interval will be used.

If iterations is specified, the timer will stop after emitting that number of events. If unspecified, then the previous value of self.iterations will be used. If the value is negative, then the timer will continue running until stop() is called.

If the timer is already running when this function is called, nothing happens (timer continues running as it did previously, without changing the interval, number of iterations, or emitting a timer start event).

stop()[source]

Stop the timer.