Re: On the sleep()





"Peter van der Goes" wrote:

>
> "hohhot" <hohhot@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:7D84E3FF-4CF8-45E2-AD93-C17CF530E8C4@xxxxxxxxxxxxxxxx
> > Hi, everyone,
> >
> > I have a question on the sleep() function.
> >
> > the prototype for sleep() is
> >
> > VOID Sleep(
> > DWORD dwMilliseconds
> > );
> >
> > dwMilliseconds
> > [in] Minimum time interval for which execution is to be suspended, in
> > milliseconds.
> >
> > But 1 milliseconds is too long for me, I need a short value for it, how
> > can
> > I do?
> >
> > Thanks a lot!
>
> I'm a bit confused. As one millisecond is 1/1000 of a second, what
> circumstances would create a need to pause an application for < 1/1000 of a
> second? Can you describe your situation so that alternative approaches might
> be suggested?
>
> --
> Peter [MVP Visual Developer]
> Jack of all trades, master of none.
>
>
>

Thank you very much, Mr. Peter.

I will explain the situation more detail now:

We are developing a communication software on the PC side, the counterparter
is a MCU.

The sleep() is called for data synchronization, but 1 millisecond is too
long -- the baud rate is 9600bps, so I need a solution, a more accurate
version sleep() for this purpose.

.