473,408 Members | 2,405 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

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

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
2 3016
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: vikas | last post by:
hi, I want to generate random numbers in c++ (using vc++ 6.0) on hit of enter. I am using _kbhit(), but don't know how to reset it, so that I can use it again, can anybody help me with this. code...
2
by: Edward Diener | last post by:
In C++ an overridden virtual function in a derived class must have the exact same signature of the function which is overridden in the base class, except for the return type which may return a...
0
by: Joe | last post by:
Dear All, I have a piece of code that loads an html page (using LoadFromResource) on to the dialog as a GUI. Every time after the user does something then a different html page will be...
10
by: Alfonso Morra | last post by:
Hi, I need help witht he sleep function as follows. I need to be write som code to do the ff: 1. creates a new thread 2. (in the new thread), Sleep for x milliseconds 3. (in the new thread),...
2
by: peleme | last post by:
Hi, Here is a code example to visualize my problem. ---------------------------------------------------------------------------------- import thread import threading from time import sleep ...
1
by: roshan | last post by:
All, Hello. I am a Software Developer currently creating an emulation program for our company's System Administrator. He will be able to call the program and emulate any keyboard combination,...
4
by: --== Alain ==-- | last post by:
Hi, under visual C++ exists a function Sleep(millisecond). What is the equivalent under Visual C++.Net ? thx, Alain
17
by: joebenjamin | last post by:
This is a problem I was trying to help a few friends figure out for fun. I am not sure how to go about this, but there is something I am missing here. Here is what we want the output to be: Need...
18
by: J.K. Baltzersen | last post by:
To whomever it may concern: I am using MS Visual C++ 6.0. I have a process A which instantiates an object C. At a later point the process A creates the thread B. The thread B has access...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.