! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Use g_timeout_add_seconds if available
Status:
CLOSED: FIXED

Comments

Description Colin Leroy 2008-12-16 08:10:24 CET
Created attachment 2040 
Patch to replace g_timeout_add to g_timeout_add_seconds

Hello,

g_timeout_add_seconds has been added in glib 2.14. The only difference when calling it instead of g_timeout_add, from the developer's point of view, is that the '*1000' in the interval goes away.

From the user's point of view, though, the difference is more important: g_timeout_add_seconds, at the expense of a little bit of preciseness, rounds and groups wake-ups, which leads to less power consumption and better battery life on laptops. You can read more about this on http://www.lesswatts.org/documentation/silicon-power-mgmnt/ for example.

The attached patch uses g_timeout_add_seconds when it's available (and defines a wrapper when it's not, to avoid multiple #if-#else-#endif blocks in the code), in the places where the delay is greater or equal to one second.

Hope this helps!
Comment 1 juha editbugs 2008-12-17 09:39:04 CET
looks good, thanks.

Will implement this after 4.6 freeze.
Comment 2 juha editbugs 2009-04-27 09:37:00 CEST
Implemented to Orage 4.7.2 available in svn.
Comment 3 juha editbugs 2011-01-18 14:03:59 CET
in 4.8.0

Bug #4723

Reported by:
Colin Leroy
Reported on: 2008-12-16
Last modified on: 2011-01-18

People

CC List:
0 users

Version

Version:
unspecified

Attachments

Additional information