1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
This action is intended for scripts to create async timers. <b>Note:</b>
timers do not work with the batch HID (no callback issued ever).
<p>
Creates a timer that executes an <arg>action</arg> (by name) periodically.
<arg>Period</arg> is a real number specified in seconds. Internal timer
resolution is in the order of 0.1 second.
<p>
If <arg>repeat</arg> is not specified or is less than 1, the timer is repeated
indefinitely. If the optional <arg>userdata</arg> string is specified, it is
also passed to the action.
<p>
The <arg>action</arg> is specified only by a name, call arguments are always
the following:
<ul>
<li> now: the current UNIX time in a floating point number
<li> integer: count back remaining number of calls, including the current call; 1 means this was the last call; 0 means infinite number of calls will follow
<li> <arg>userdata</arg> or empty string
</ul>
<p>
<arg>Action</arg> shall return integer 0 on success.
If the action does not exist or returns anything else, the timer is
uninstalled.
<p>
There can be any number of timers in parallel.
|