Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-98316

QTimer on Windows uses excessive power for timers

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P3: Somewhat important P3: Somewhat important
    • 6.4.0 Beta1
    • 5.12.11, 6.2.1, 7.0 (Next Major Release)
    • Core: Event loop
    • None
    • Windows
    • 5e2ce03510 (qt/qtbase/dev) 5e2ce03510 (qt/tqtc-qtbase/dev)

      I discovered this issue after looking at the Quassel bug tracker, and saw Bug #1521: Quassel requests 1ms timer precision on Windows client - Quassel IRC - Quassel IRC Issue Tracker (quassel-irc.org); the issue is that when creating a QTimer, even at coarse resolution, the system timer created is high resolution and is unnecessarily power-hungry, especially on mobile devices.

      While precision timers should retain the call to SetTimer when unable to use multimedia timers, Qt::CoarseTimer and Qt::VeryCoarseTimer should instead use SetCoalescableTimer, which offers similar guarantees to the existing descriptions of coarse and very coarse timers, but will be significantly more efficient. A document linked in the description of uToleranceDelay describes the benefits that come from using coalescing timers; this will have a significant impact on all timer users.

        For Gerrit Dashboard: QTBUG-98316
        # Subject Branch Project Status CR V

            thiago Thiago Macieira
            ben_zen Ben Lewis
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes