Package: glib

Function g-timeout-add-seconds

Lambda List

g-timeout-add-seconds (interval func &key priority)

Arguments

interval -- an unsigned integer with the time between calls to func, in seconds
function -- a g-source-func callback function to call
priority -- an integer with the priority of the timeout source, typically this will be in the range between +g-priority-default+ and +g-priority-high+ values

Return Value

The unsigned integer ID greater than 0 of the event source.

Details

Sets a function to be called at regular intervals with priority. The default value is +g-priority-default+. The function is called repeatedly until it returns false, at which point the timeout is automatically destroyed and the function will not be called again.

This internally creates a main loop source using the g-timeout-source-new-seconds function and attaches it to the main loop context using the g-source-attach function. You can do these steps manually if you need greater control.

Note that the first call of the timer may not be precise for timeouts of one second. If you need finer precision and have such a timeout, you may want to use the g-timeout-add function instead.
 

See also

2021-12-10