From 23c0aa17c505005152f30f9d63a54ca2d70c55f9 Mon Sep 17 00:00:00 2001 From: Paul Pogonyshev Date: Wed, 24 Dec 2008 19:36:08 +0000 Subject: Bug 547119 – gobject.timeout_add_seconds() not found in docs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2008-12-24 Paul Pogonyshev Bug 547119 – gobject.timeout_add_seconds() not found in docs * docs/reference/pyglib-functions.xml (glib.timeout_add_seconds): Describe. svn path=/branches/pygobject-2-16/; revision=982 --- docs/reference/pyglib-functions.xml | 64 +++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) (limited to 'docs/reference/pyglib-functions.xml') diff --git a/docs/reference/pyglib-functions.xml b/docs/reference/pyglib-functions.xml index 3464a80..59a590d 100644 --- a/docs/reference/pyglib-functions.xml +++ b/docs/reference/pyglib-functions.xml @@ -25,6 +25,12 @@ linkend="function-glib--timeout-add">glib.timeout_add ... glib.timeout_add_seconds + interval + callback + ... + + glib.io_add_watch fd condition @@ -186,6 +192,64 @@ in delays). + + glib.timeout_add_seconds + + + glib.timeout_add_seconds + interval + callback + ... + + + + interval : + the time between calls to the function, in +seconds + + + callback : + the function to call + + + ... : + zero or more arguments that will be passed to +callback + + + Returns : + an integer ID of the event +source + + + + The glib.timeout_add_seconds() is similar to + glib.timeout_add() except + that interval must be specified in seconds, not + milliseconds, and the function should cause less CPU wakeups, which is important + for laptops' batteries. + + Unlike glib.timeout_add(), this function operates at + whole second granularity. The initial starting point of the timer is determined + by the implementation and the implementation is expected to group multiple timers + together so that they fire all at the same time. To allow this grouping, the + interval to the first timer is rounded and can deviate up to one second from the + specified interval. Subsequent timer iterations will generally run at the + specified interval. + + Note that timeout functions may be delayed, due to the processing of other + event sources. Thus they should not be relied on for precise timing. After each + call to the timeout function, the time of the next timeout is recalculated based + on the current time and the given interval. + + The grouping of timers to fire at the same time results in a more power and + CPU efficient behavior so if your timer is in multiples of seconds and you don't + require the first timer exactly one second from now, the use of + glib.timeout_add_seconds() is preferred + over glib.timeout_add(). + + + glib.io_add_watch -- cgit