Re: How To program for an Accurate sub-second clock
From: John Smith (soneone_at_microsoft.com)
Date: 07/05/04
- Next message: John Smith: "Re: How To program for an Accurate sub-second clock"
- Previous message: Maarten Struys, eMVP: "Re: Smart Device Wizard"
- In reply to: Andrey Yatsyk: "Re: How To program for an Accurate sub-second clock"
- Next in thread: John Smith: "Re: How To program for an Accurate sub-second clock"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 5 Jul 2004 11:27:13 +0100
"Andrey Yatsyk" <andrew_NO_SPAM_@softspb.com> wrote in message
news:eDFcS7mYEHA.3972@TK2MSFTNGP12.phx.gbl...
> Set the timer with elapse period much less then a second and increment
your
> counters only when seconds value changnes.
> If this solution is not good for you for some reason, you can create
second
> thread that will invoke some method in first thread every second.
> For more info about system counters look at QueryPerformanceCounter and
> GetTickCount functions.
>
> --
> Andrey Yatsyk [eMVP]
>
>
> "John Smith" <soneone@microsoft.com> wrote in message
> news:ccb32g$lvq$1@newstree.wise.edt.ericsson.se...
> > Hi All
> >
> > I'm using EVC++ 4.0. I'm also new to MFC.
> >
> > I've used a timer event to provide a 'tick' which is then used to
> increment
> > my counters, and I display this as time
> > (hours:minutes:seconds:milliseconds).
> >
> > However, it seems very inaccurate.
> >
> > Is there an event from e.g. a real-time clock which I could use instead?
> It
> > would be nice to be able to count in say tenths of a second, but not
> > essential: minimum is to count seconds.
> >
> > Thanks
> >
> >
>
>
Hi Andrey
Thanks for the reply. I've tried (a single threaded app) to use an elapsed
period of 1 millisecond, 10ms, and 100ms. The clock itself only increments
in 1 second intervals. Within two minutes of running, it shows a large
discrepency as compared to a real stopwatch, in the order of a few seconds.
This is too inaccurate to work with.
I'll check out the functions you've mentioned.
Thanks
- Next message: John Smith: "Re: How To program for an Accurate sub-second clock"
- Previous message: Maarten Struys, eMVP: "Re: Smart Device Wizard"
- In reply to: Andrey Yatsyk: "Re: How To program for an Accurate sub-second clock"
- Next in thread: John Smith: "Re: How To program for an Accurate sub-second clock"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|