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. Better SetTimer

Better SetTimer

Scheduled Pinned Locked Moved C / C++ / MFC
csstutorialquestion
3 Posts 3 Posters 2 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.
  • M Offline
    M Offline
    Manikandan
    wrote on last edited by
    #1

    Hi, We all know that we can set the minimum one milliseconds elapse time with SetTimer function. Can anyone tell me how to set less than 1 ms say 500 micro seconds?:rolleyes:

    P P 2 Replies Last reply
    0
    • M Manikandan

      Hi, We all know that we can set the minimum one milliseconds elapse time with SetTimer function. Can anyone tell me how to set less than 1 ms say 500 micro seconds?:rolleyes:

      P Offline
      P Offline
      Prem Kumar
      wrote on last edited by
      #2

      Have a look at http://www.codeproject.com/system/timers\_intro.asp#MMTimers

      1 Reply Last reply
      0
      • M Manikandan

        Hi, We all know that we can set the minimum one milliseconds elapse time with SetTimer function. Can anyone tell me how to set less than 1 ms say 500 micro seconds?:rolleyes:

        P Offline
        P Offline
        Paul M Watt
        wrote on last edited by
        #3

        You will want to look at QueryPerformanceCounter and QueryPerformanceFrequency. Most computers now have this high resolution timer, however some of the older ones do not. IN those cases you will have to rely on the Multimedia timer which has a resolution of 1 millisecond. By the way, I believe the timer resolution on the system timer with WM_TIMER has a resolution of 55 milliseconds. Good Luck.


        Build a man a fire, and he will be warm for a day
        Light a man on fire, and he will be warm for the rest of his life!

        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