! 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 for less wake-ups
Status:
RESOLVED: FIXED
Product:
Xfce4-cpufreq-plugin
Component:
General

Comments

Description Morten 2009-04-02 10:49:50 CEST
Created attachment 2267 
Use g_timeout_add_seconds() when glib version >= 2.14

Cpufreq panel plugin is often used on laptops. It currently uses g_timeout_add() for the timers controlling how often we read the current frequency.

From glib documentation on g_timeout_add (); If you want to have a
timer in the "seconds" range and do not care about the exact time of
the first call of the timer, use the g_timeout_add_seconds() function;
this function allows for more optimizations and more efficient system
power usage.

Now this plugin is used on laptops and as a user I do want to see the current frequency, but not with the cost of worse battery life. So added a patch that uses g_timeout_add_seconds().

Pros: better battery life
Drawback: lower update interval

Patch based on http://trac.transmissionbt.com/changeset/7463

More on powersaving and timers: http://mjg59.livejournal.com/74651.html?thread=452251
Comment 1 Morten 2009-04-02 11:40:02 CEST
Created attachment 2268 
Update patch with check of data from config file
Comment 2 Florian Rivoal editbugs 2010-12-30 19:27:53 CET
The code has changed since the patch was submitted, so it doesn't apply, but I made similar changes.

Bug #5180

Reported by:
Morten
Reported on: 2009-04-02
Last modified on: 2014-12-07

People

Assignee:
Thomas Schreck
CC List:
1 user

Version

Version:
0.0.1 or older

Attachments

Additional information