Re: Microsecond delay in Windows?



Arun wrote:
"Tom Widmer [VC++ MVP]" <tom_usenet@xxxxxxxxxxx> wrote in message
news:OoTJNTmpGHA.4812@xxxxxxxxxxxxxxxxxxxxxxx

I don't think the OP said he needed 1 microsecond specifically (though
he wasn't very clear), rather the delay he wants is measured in
microseconds rather than, for example, milliseconds. It might be, e.g.
295 microseconds.

Yes! Certainly. The delay has to be as small as possible with the
possibility of recurring the delay with the same precision & accuracy!!!
The entire delay cycle may not extend to an extent so as to cause unusual
problems to the Windows-OS!

Could you precisely define what you're trying to do, and why? It's hard to suggest solutions to something as vague as this.

It seems you need some code like this:

loop
some code
a delay
end loop

From what you've said, 'a delay' has certain constraints on how long it runs, though you haven't defined those constraints (other than something about "microsecond"). Also, does 'some code' have any constraints on its running time? In effect, do you need the whole loop to take a fixed amount of time to execute (e.g. 'some code' must execute every 500us)? Can 'some code' take highly variable amount of time to execute, or does it do much the same on every loop?

Tom
.



Relevant Pages

  • Re: Write Signal on Disk II Question
    ... checked for sampling jitter using an oscilloscope? ... But I noticed another shocking thing: The timing loop I used to find ... the timing resolution is quite high, since the delay loop on the main ...
    (comp.sys.apple2)
  • Re: Write Signal on Disk II Question
    ... checked for sampling jitter using an oscilloscope? ... But I noticed another shocking thing: The timing loop I used to find ... the timing resolution is quite high, since the delay loop on the main ...
    (comp.sys.apple2)
  • Re: Write Signal on Disk II Question
    ... checked for sampling jitter using an oscilloscope? ... But I noticed another shocking thing: The timing loop I used to find ... the timing resolution is quite high, since the delay loop on the main ...
    (comp.sys.apple2)
  • Re: Write Signal on Disk II Question
    ... checked for sampling jitter using an oscilloscope? ... But I noticed another shocking thing: The timing loop I used to find ... the timing resolution is quite high, since the delay loop on the main ...
    (comp.sys.apple2)
  • Re: Please help me figure out a delay loop
    ... >> I'm having problems with creating a delay loop for a snake game I created ... the real-time clock is used. ... The rdtsc instruction loads that value into edx:eax. ...
    (comp.lang.asm.x86)

Quantcast