This action is intended for scripts to create async timers. Note: timers do not work with the batch HID (no callback issued ever).

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.

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.

The <arg>action</arg> is specified only by a name, call arguments are always the following:

- now: the current UNIX time in a floating point number
- 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
- <arg>userdata</arg> or empty string

<arg>Action</arg> shall return integer 0 on success. If the action does not exist or returns anything else, the timer is uninstalled.

There can be any number of timers in parallel.