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. High resolution Timer

High resolution Timer

Scheduled Pinned Locked Moved C / C++ / MFC
question
4 Posts 4 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.
  • D Offline
    D Offline
    DavidR_r
    wrote on last edited by
    #1

    How can I implement timer in in Windows (2000/XP )with resolution of 1 milisecond or better. Multimedia timer seems to be not accurate enough, but may be I am not using it right? Thanks DavidR

    A 1 Reply Last reply
    0
    • D DavidR_r

      How can I implement timer in in Windows (2000/XP )with resolution of 1 milisecond or better. Multimedia timer seems to be not accurate enough, but may be I am not using it right? Thanks DavidR

      A Offline
      A Offline
      Arsalan Malik
      wrote on last edited by
      #2

      High Resolution Elapsed Timer[^] ARSALAN MALIK

      J 1 Reply Last reply
      0
      • A Arsalan Malik

        High Resolution Elapsed Timer[^] ARSALAN MALIK

        J Offline
        J Offline
        Jon Hulatt
        wrote on last edited by
        #3

        Bear in mind that although you can use QueryPerformanceCounter() to get an accurate elapsed time, you *cannot* get things to happen regularly at for example 1ms intervals. Windows has an internal "clock" of (from memory) 12.5ms, and doing anything more often than that (reliably) just doesn't work.

        using System.Beer;

        D 1 Reply Last reply
        0
        • J Jon Hulatt

          Bear in mind that although you can use QueryPerformanceCounter() to get an accurate elapsed time, you *cannot* get things to happen regularly at for example 1ms intervals. Windows has an internal "clock" of (from memory) 12.5ms, and doing anything more often than that (reliably) just doesn't work.

          using System.Beer;

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          Jon Hulatt wrote: Windows has an internal "clock" of (from memory) 12.5ms... Close. For Windows 9x/Me, the system clock ticks at 55 ms. For Windows NT, it ticks at 10 ms. This is the best that can be obtained with a non-RTOS system.


          "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

          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