gmain: Clarify that timeouts are in terms of monotonic time

Also note that monotonic time does not include time spent while
suspended (at least on Linux).

https://bugzilla.gnome.org/show_bug.cgi?id=655129
This commit is contained in:
Colin Walters 2011-08-13 06:03:18 -04:00
parent 527dc86722
commit f0db0d22cc

View File

@ -2024,10 +2024,13 @@ g_get_real_time (void)
* that probably involves returning the wall clock time (with at least * that probably involves returning the wall clock time (with at least
* microsecond accuracy, subject to the limitations of the OS kernel). * microsecond accuracy, subject to the limitations of the OS kernel).
* *
* Note that, on Windows, "limitations of the OS kernel" is a rather * It's important to note that POSIX %CLOCK_MONOTONIC does not count
* substantial statement. Depending on the configuration of the system, * time spent while the machine is suspended.
* the wall clock time is updated as infrequently as 64 times a second *
* (which is approximately every 16ms). * On Windows, "limitations of the OS kernel" is a rather substantial
* statement. Depending on the configuration of the system, the wall
* clock time is updated as infrequently as 64 times a second (which
* is approximately every 16ms).
* *
* Returns: the monotonic time, in microseconds * Returns: the monotonic time, in microseconds
* *
@ -3919,6 +3922,9 @@ g_timeout_dispatch (GSource *source,
* and must be added to one with g_source_attach() before it will be * and must be added to one with g_source_attach() before it will be
* executed. * executed.
* *
* The interval given is in terms of monotonic time, not wall clock
* time. See g_get_monotonic_time().
*
* Return value: the newly-created timeout source * Return value: the newly-created timeout source
**/ **/
GSource * GSource *
@ -3946,6 +3952,9 @@ g_timeout_source_new (guint interval)
* The scheduling granularity/accuracy of this timeout source will be * The scheduling granularity/accuracy of this timeout source will be
* in seconds. * in seconds.
* *
* The interval given in terms of monotonic time, not wall clock time.
* See g_get_monotonic_time().
*
* Return value: the newly-created timeout source * Return value: the newly-created timeout source
* *
* Since: 2.14 * Since: 2.14
@ -3992,6 +4001,9 @@ g_timeout_source_new_seconds (guint interval)
* and attaches it to the main loop context using g_source_attach(). You can * and attaches it to the main loop context using g_source_attach(). You can
* do these steps manually if you need greater control. * do these steps manually if you need greater control.
* *
* The interval given in terms of monotonic time, not wall clock time.
* See g_get_monotonic_time().
*
* Return value: the ID (greater than 0) of the event source. * Return value: the ID (greater than 0) of the event source.
* Rename to: g_timeout_add * Rename to: g_timeout_add
**/ **/
@ -4047,6 +4059,9 @@ g_timeout_add_full (gint priority,
* and attaches it to the main loop context using g_source_attach(). You can * and attaches it to the main loop context using g_source_attach(). You can
* do these steps manually if you need greater control. * do these steps manually if you need greater control.
* *
* The interval given is in terms of monotonic time, not wall clock
* time. See g_get_monotonic_time().
*
* Return value: the ID (greater than 0) of the event source. * Return value: the ID (greater than 0) of the event source.
**/ **/
guint guint
@ -4098,6 +4113,9 @@ g_timeout_add (guint32 interval,
* using g_source_attach(). You can do these steps manually if you need * using g_source_attach(). You can do these steps manually if you need
* greater control. * greater control.
* *
* The interval given is in terms of monotonic time, not wall clock
* time. See g_get_monotonic_time().
*
* Return value: the ID (greater than 0) of the event source. * Return value: the ID (greater than 0) of the event source.
* *
* Rename to: g_timeout_add_seconds * Rename to: g_timeout_add_seconds
@ -4147,6 +4165,9 @@ g_timeout_add_seconds_full (gint priority,
* of one second. If you need finer precision and have such a timeout, * of one second. If you need finer precision and have such a timeout,
* you may want to use g_timeout_add() instead. * you may want to use g_timeout_add() instead.
* *
* The interval given is in terms of monotonic time, not wall clock
* time. See g_get_monotonic_time().
*
* Return value: the ID (greater than 0) of the event source. * Return value: the ID (greater than 0) of the event source.
* *
* Since: 2.14 * Since: 2.14