gra.timer

Start, stop and control a timer.

Plugin:

libgre-plugin-timer.so

Options:
name

The name to use to identify this timer (required)

rtime

The time delay in milliseconds relative to the action invocation. Specify a value of 0 to stop an existing timer.

repeat

The number of milliseconds to delay after the timer first fires, used to provide a stable repeat timer. Specify 0 for a one shot timer.

count

The number of times that the timer should repeat before automatically stopping, assuming that the timer is not a one shot timer. Specify -1 to allow an unlimited number of repeat firings

rtime must be specified and a value of 0 for rtime and repeat indicates that the timer should stop firing.

For example, to start a timer that fires in 1s from the event and then every 500ms afterwards:

<action ... type="gra.timer" data="name=MyTimer,rtime=1000,repeat=500" />

Then to stop the timer:

<action ... type="gra.timer" data="name=MyTimer,rtime=0,repeat=0" />

An event will be generated each time that the timer fires and will be named timer.<name> so for the examples above, the event would be generated would be timer.MyTimer.