Hi,

I have a dedicated thread in my program that always polls the parallel port in 1ms intervalls. The problem is that I have it in a continuous while-loop and the cpu usage is going to 99%.

I tried inserting a "sleep(x)" with x being anything between 0-5, but the problem is that sleep uses the system timer and that has a 15ms resolution, so even a sleep(0) can wait up to 15 milliseconds. I used the Performance Counter to verify that.

Is there a way to prevent the thread from hogging all the cpu ?