By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,443 Members | 1,409 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,443 IT Pros & Developers. It's quick & easy.

Problem with Sleep(); function in VC++ 6.0

P: n/a
Ed
For some reason when I use the code Sleep(1); which is supposed to be 1
millisecond I am seeing a delay of 10ms.
Any ideas??
I need a delay of about 1-1.5 ms.
Thanks
Dec 23 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Ed wrote:
For some reason when I use the code Sleep(1); which is supposed to be
1 millisecond I am seeing a delay of 10ms. Any ideas??
That's a platform-specific, non-standard function. You'll need to post
to a VC related newsgroup. There may be some help with that here:

<http://www.parashift.com/c++-faq-lite/how-to-post.html#faq-5.9>


Brian
Dec 23 '06 #2

P: n/a
Ed wrote:
For some reason when I use the code Sleep(1); which is supposed to be 1
millisecond I am seeing a delay of 10ms.
Any ideas??
I need a delay of about 1-1.5 ms.
You will find much more success by asking your question in a news group
related to your compiler or do a google for "high resolution sleep win32
msdn".

In general, if you need synchronization at intervals smaller than 10ms,
you're looking at some specialized functionality of the operating system
or the processor you're using and depending on your task, you may be
required to look at using a "real time" operating system.
Dec 23 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.