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. Other Discussions
  3. Article Writing
  4. Need a Microsecond Delay Fnc

Need a Microsecond Delay Fnc

Scheduled Pinned Locked Moved Article Writing
question
6 Posts 5 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.
  • T Offline
    T Offline
    toothless boots
    wrote on last edited by
    #1

    I'm working on a project that requires a delay time in microseconds. Anybody have any ideas?

    S L R 3 Replies Last reply
    0
    • T toothless boots

      I'm working on a project that requires a delay time in microseconds. Anybody have any ideas?

      S Offline
      S Offline
      Sarvesvara BVKS Dasa
      wrote on last edited by
      #2

      What language / platform u use? He who controls others may be powerful,
      But he who has mastered himself is mightier still.

      T 1 Reply Last reply
      0
      • S Sarvesvara BVKS Dasa

        What language / platform u use? He who controls others may be powerful,
        But he who has mastered himself is mightier still.

        T Offline
        T Offline
        toothless boots
        wrote on last edited by
        #3

        Sorry. I'm using MFC - Visual C++ on Windows XP

        P 1 Reply Last reply
        0
        • T toothless boots

          Sorry. I'm using MFC - Visual C++ on Windows XP

          P Offline
          P Offline
          patnsnaudy
          wrote on last edited by
          #4

          The shortest period you can give up a time slice for is around 14 milliseconds on a Windows system. I think anytime you Sleep(...) you will sleep for some multiple of approx 14 milliseconds. Windows is not real time. :(( If you want to spin in a while loop to delay look into QueryPerformanceCounter in the msdn. J

          1 Reply Last reply
          0
          • T toothless boots

            I'm working on a project that requires a delay time in microseconds. Anybody have any ideas?

            L Offline
            L Offline
            Lymington
            wrote on last edited by
            #5

            WinMM.lib gives possibility of one millisecond callbacks on a seperate thread, which one can boost priority to make sure free-running. timeSetTimer & timeKillTimer are the relevant functions, viz. MSDN Better than (+/-) 7mSecs, but perhaps not good enough? Lymington

            1 Reply Last reply
            0
            • T toothless boots

              I'm working on a project that requires a delay time in microseconds. Anybody have any ideas?

              R Offline
              R Offline
              Rick York
              wrote on last edited by
              #6

              If you truly need to delay in microseconds you will probably have to resort to assembly language and NOOPs. There is absolutely no guarantee that this will be deterministic though. __________________________________________ a two cent stamp short of going postal.

              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