Vizard 7 » Command Index » Vizard modules » vizact » <vizact>.ontimer
7.3

<vizact>.ontimer

Perform an action on a certain time interval.

<vizact>.ontimer(  
rate  
func  
*args  
)  
rate
The rate at which to call the function (in seconds)
func
The function to call when the timer expires
*args
Arguments to pass to func.

Remarks

This will call the specified function with the specified arguments on the specified interval. The timer will repeat indefinitely.

Return Value

A vizact.EventFunction object with the following methods:

Method

Description

<event>.setEnabled(val)

Enable/Disable the event function. The associated function will not be called while the event function is disabled. viz.TOGGLE can be used to toggle the state. Event functions are initially enabled.

<event>.getEnabled()

Get the enabled state of the event function.

<event>.remove()

Permanently unregister the event function.

Example

def dostuff():
    print(viz.getFrameNumber())
vizact.ontimer(1,dostuff)

See also

<vizact>.ontimer2
<vizact>.onupdate