
Sleep API is using up 60% CPU time in the DLL
I created a simple VB COM DLL to monitor the message queue.
While Flag = "1"
Check there is anything stuck in the message queue.
Sleep 50000
Wend
I called the Sleep API function to yield the CPU time to other
process. However, it takes 50%-60% of the CPU time all the time once
this DLL is created and start running. Once I killed the process. The
CPU usage time is back to normal. 98% idle time. I have tried to
increase the Sleep time interval to 5 minutes and it still not seems
solve the problem. I started this DLL from the SQL Job. Is anything
wrong in the Sleep API?
Henry