From 0c2446b7edd45b7651f1fc556baa24d8488d0f9f Mon Sep 17 00:00:00 2001 From: Paul Pogonyshev Date: Wed, 24 Dec 2008 19:38:02 +0000 Subject: Merge from 2.16 branch: 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=/trunk/; revision=983 --- ChangeLog | 7 ++++ docs/reference/pyglib-functions.xml | 64 +++++++++++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+) diff --git a/ChangeLog b/ChangeLog index b3ec919..1d0e299 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +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. + 2008-12-21 Paul Pogonyshev Bug 564102 – _wrap_g_output_stream_write_async not adding a 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