Is that what that is? I thought he was timing the data transmission.
AliR.
"Joseph M. Newcomer" <newcomer@flounder.com> wrote in message
That is exceptionally poor code for sending things out at specific
intervals. It means
you are in some kind of spin loop polling for the passage of time. This
is Really Bad
Idea.
You should be considering using WM_TIMER (which can have finer resolution,
down to the
system clock tick interval, but see my essay "Time is the simplest thing")
Or, you use the timeSetTimeEvent and a timer callback. Be aware that the
callback is
executed in a separate thread of control. This will give you very fine
control.
joe
On 10 Apr 2007 08:58:10 -0700, "Hoop" <jcollett@oshtruck.com> wrote:
Hi,
In an older MFC app that I am working on we use the CTime class, which
goes down to seconds. I need about .5 seconds.
Is there a MFC timer class that I can get milliseconds from?
What I am doing is pasted below. The GetTotalSeconds() will just work
down to 1 sec
elapsedTime = CTime::GetCurrentTime();
diffTime = elapsedTime - startTime;
if (diffTime.GetTotalSeconds() >= .5)
{
send some data....
startTime = CTime::GetCurrentTime();
}
Thanks for any help
Jeff
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm