Click to See Complete Forum and Search --> : A thread problem...


pradish
October 26th, 2005, 07:32 AM
Hi all

How can we make the Sleep(milliseconds) function to be more
accurate.i:e if it is Sleep(500), The Thread should wakeup exactly after
500ms. I need this to be implemented in workerthread.

Your valueable suggestions are welcome.


regards
pradish

ovidiucucu
October 26th, 2005, 07:49 AM
[ Redirected thread ]

Marc G
October 26th, 2005, 07:50 AM
The Sleep function is never really accurate. Windows is not a realtime operating system. However, you might get beter accuracy with multimedia timers. Do a search for them on codeguru or google.

pradish
October 26th, 2005, 10:32 AM
you might get beter accuracy with multimedia timers.

But how do i replace this with sleep() function in a worker thread



regards
pradish

Marc G
October 28th, 2005, 07:24 AM
Take a look at the Multimedia Timers SDK documentation (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/multimed/htm/_win32_multimedia_timers.asp).