Results 1 to 7 of 7

Thread: QTimer behavior when timer processing length goes beyond timer interval

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QTimer behavior when timer processing length goes beyond timer interval

    The way QTimer is handled is that it is put into a queue sorted by time when it should fire next (now+interval). When events are processed by the application, when the event queue is already empty the dispatcher checks the timer queue. If the time of next timeout is less or equal to the current time, the timer is fired and if it is not single shot, it is rescheduled in the queue again (now+interval). I would assume there is also some mechanism to prevent latency buildup.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  2. The following user says thank you to wysota for this useful post:

    andariel (4th September 2014)

  3. #2
    Join Date
    Oct 2013
    Posts
    7
    Thanks
    2
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QTimer behavior when timer processing length goes beyond timer interval

    Wysota,
    thanks a lot for that detailed explanation of how the QTimer works, very instructive. So this confirms there can be at any single point of time only one timer event for a given timer waiting to be executed.

Similar Threads

  1. Freeze using QTimer with interval 0
    By Alundra in forum Qt Programming
    Replies: 22
    Last Post: 7th August 2013, 14:13
  2. timer problem(timer does not work)
    By masuk in forum Newbie
    Replies: 6
    Last Post: 14th February 2011, 05:00
  3. How to add timer delay
    By qtUse in forum Newbie
    Replies: 1
    Last Post: 12th October 2010, 18:09
  4. watchdog timer implementation based on QTimer
    By araglin in forum Qt Programming
    Replies: 3
    Last Post: 18th May 2009, 15:34
  5. Timer delay
    By bmn in forum Qt Programming
    Replies: 11
    Last Post: 3rd June 2008, 11:54

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.