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

QTimer on Windows uses excessive power for timers

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3: Somewhat important
    • Resolution: Done
    • Affects Version/s: 5.12.11, 6.2.1, 7.0 (Next Major Release)
    • Fix Version/s: 6.4.0 Beta1
    • Component/s: Core: Event loop
    • Labels:
      None
    • Platform/s:
      Windows
    • Commits:
      5e2ce03510 (qt/qtbase/dev) 5e2ce03510 (qt/tqtc-qtbase/dev)

      Description

      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.

        Attachments

          Issue Links

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

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes