Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. one or many queue timers ?

one or many queue timers ?

Scheduled Pinned Locked Moved C / C++ / MFC
cssdatabasedata-structuresquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    Ed01
    wrote on last edited by
    #1

    Hi, I have to use a timer to perform some tasks at specific intervals. The timer needs to be very accurate (+- 10 ms) and use as less CPU as possible. So I decided to use a queue timer, which seems to be the better choice. In fact, I have to trigger many events at different intervals. For exemple, I have to do something each 30 ms, another task each 120 ms and another one each 350 ms (between 1 to 25 events to trigger). What I'd like to know is which is the best solution : - using only one timer that calls only one callback procedure each 10 ms for exemple and in this procedure increments variables to know which task to process - or set up one timer with one callback procedure for each task I'd like to perform. (so it's as if I defined 25 timers but with intervalls of 30 ms, 120 ms, 350 ms ...) Thanks... Edouard

    D V 2 Replies Last reply
    0
    • E Ed01

      Hi, I have to use a timer to perform some tasks at specific intervals. The timer needs to be very accurate (+- 10 ms) and use as less CPU as possible. So I decided to use a queue timer, which seems to be the better choice. In fact, I have to trigger many events at different intervals. For exemple, I have to do something each 30 ms, another task each 120 ms and another one each 350 ms (between 1 to 25 events to trigger). What I'd like to know is which is the best solution : - using only one timer that calls only one callback procedure each 10 ms for exemple and in this procedure increments variables to know which task to process - or set up one timer with one callback procedure for each task I'd like to perform. (so it's as if I defined 25 timers but with intervalls of 30 ms, 120 ms, 350 ms ...) Thanks... Edouard

      D Offline
      D Offline
      De Nardis Andrea
      wrote on last edited by
      #2

      In our experience it is far better to make different timers. Pls note that queue timer do not seem to have much accuracy, better are multimedia timers (timeSetTimer) or waitable timers (CreateWaitableTimer). Regards, andrea;P

      1 Reply Last reply
      0
      • E Ed01

        Hi, I have to use a timer to perform some tasks at specific intervals. The timer needs to be very accurate (+- 10 ms) and use as less CPU as possible. So I decided to use a queue timer, which seems to be the better choice. In fact, I have to trigger many events at different intervals. For exemple, I have to do something each 30 ms, another task each 120 ms and another one each 350 ms (between 1 to 25 events to trigger). What I'd like to know is which is the best solution : - using only one timer that calls only one callback procedure each 10 ms for exemple and in this procedure increments variables to know which task to process - or set up one timer with one callback procedure for each task I'd like to perform. (so it's as if I defined 25 timers but with intervalls of 30 ms, 120 ms, 350 ms ...) Thanks... Edouard

        V Offline
        V Offline
        valikac
        wrote on last edited by
        #3

        I have not designed an application that processes data in a time interval of unver 1000 ms. a time queue timer is one solution for For processs that work in the 500+ ms range. For anything shorter, I recommend a separate worker thread and WaitForSingleObject(). Kuphryn

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups