Decrease CPU usage of datetime by events

Bug #1533911 reported by Bartosz Kosiorek on 2016-01-14
This bug affects 1 person
Affects Status Importance Assigned to Milestone
indicator-datetime (Ubuntu)

Bug Description

Currently in ./src/wakeup-timer-mainloop.cpp
the g_timeout_add_full function is used to call intervals:

        const auto now = m_clock->localtime();
        const auto difference_usec = g_date_time_difference(m_wakeup_time.get(), now.get());
        const guint interval_msec = std::abs(difference_usec) / 1000u;
        g_debug("%s setting wakeup timer to kick at %s, which is in %zu seconds",
                m_wakeup_time.format("%F %T").c_str(),

        m_timeout_tag = g_timeout_add_full(G_PRIORITY_HIGH,
More information:

The grouping of timers to fire at the same time results in a more power and CPU efficient behavior
That's why I would recommend to use:
   g_timeout_add_seconds_full ()

Charles Kerr (charlesk) wrote :

Good suggestion! Thanks Bartosz.

Changed in indicator-datetime (Ubuntu):
assignee: nobody → Charles Kerr (charlesk)
importance: Undecided → Low
status: New → Triaged
Changed in indicator-datetime (Ubuntu):
assignee: Charles Kerr (charlesk) → nobody
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers