hi all,

i was looking for some delay function to perform particular delays:

5 micro secs
100 nano secs

but I need to do that the delays don't change between my 2Ghz PC and another PC.

I also need precision, since i don't want that another process can slow down my app.

If any suggestion,

Posted on 2002-11-30 04:41:06 by Bit7
AFAIK, Win32 API provides the granulity of milliseconds. So, it seems to me that you might need to devise your own timer unless you try another OS.

If millisecond level is OK, see SetTimer()/KillTimer() for delay operation - doing something while waiting for the timer expiration. Or, to delay while you are waiting for something to complete, WaitFor...() family of functions. Or, SleepEx() is a no-brainer (read, MT-unsafe) delay function.
Posted on 2002-11-30 21:29:42 by Starless
MS$ advise against using to many Wait function. I forgot the reasons. ( I know you don't want Sleep but that is always good that has nothing to do with MS$ per say )

As Starless said devise your own timer should be something that i think you can do if you are not press for time.... I read about this back when fl00der was sending out links about timers. He also got a lot of stuff that you should see since this is your subject, remember.
Posted on 2002-11-30 22:30:46 by cmax

at the moment i've solved my trouble.
I've done a cicles measurement in 1 msec.
With this number of cycles i can adapt the delay at every PC, multipliing my delay for that number.

At the moment i've obtainted quite good delays for my purpose, I think i dont need more precision :)

Posted on 2002-12-01 06:42:16 by Bit7

maybe QueryPerformanceCounter and QueryPerformanceFrequency would help? or maybe rdtsc? what unit is the value in edx:eax that rdtsc returns in??

Posted on 2002-12-01 07:40:22 by stormix
RDTSC answers in clock cycles if I remember correctly.
Posted on 2002-12-01 20:54:40 by GogetaSSJ4