Re: More accurate Timerevent
- From: Jamie <jamie_ka1lpa_not_valid_after_ka1lpa_@xxxxxxxxxxx>
- Date: Tue, 21 Nov 2006 19:28:38 -0500
Peter Ingham wrote:
On Tue, 21 Nov 2006 21:22:37 GMT, Dirk Claessens <No@xxxxxxxxxxx>you're wrong also.
wrote:
On 2006-11-20, Gert Baars (62.194.53.8) wrote in
message <73d6e$4561b3d6$3ec23508$15065@xxxxxxxxxxxxxx>
Hello,
Thank you for info. I'd like to try timeSetEvent but Delphi 7 doesn't
recognize it and helpfunction neither. Do I need to add a .dcu at 'uses'? Is this somehow documented?
Gert,
Don't bother looking for it... it's a waist of time.
You **cannot** generate accurately timed events on a Windows platform. As others said: you need hardware.
On modern PC's, You are wrong, and the "others" you mention are also
wrong.
Try the following:
GetTickCount() has a resolution of 1 ms, so we would expect to see it's value incrementing by 1 ms or there about , right?
The value returned does have a resolution of 1 ms. The timer it is
measuring has a precision which is greater (10-15ms depending). You
simply are misunderstanding the behaviour characteristics of *one* of
the clocks available under Windows.
Time measurement, in any environment, is not a simple as most people
perceive.
For more info on time measurement in general, check out the NTP
reference material.
For a good discussion on PC Hardware Timers, Google for VMWare and
Timers.
--
Please remove '_SpamTrap' when replying. You know why :-(
Peter Ingham
Lower Hutt
New Zealand
The PC has always had an accurate time event +/- a bit because
they do have hardware clocks how ever, the even signaling to your
app is not going to happen on time. Windows does not halt every other
app, services and drivers at the time of the desired count for your app.
It will signal the app when it gets time. When doing a test
on the actual time that has past since the last time you checked the hardware clock, you will find that your event timing is all over the
place.
if you're trying to sample something at precise moments, this is not
going to work.
Point and case which has already been stated..
You need a hardware or a low level driver that handles the
IRQ of a timer from the PC or an add on board. all the sensitive
processing can be done then. even with that, you need to use a
board that can buffer up some data and place a mark at which point
where the event took place so that, later on it can be properly indexed
out.
Just think of trying to read a serial port RX pin signal and try to time that using that method in software under windows.
--
"I'm never wrong, once i thought i was, but was mistaken"
Real Programmers Do things like this.
http://webpages.charter.net/jamie_5
.
- Follow-Ups:
- Re: More accurate Timerevent
- From: Dirk Claessens
- Re: More accurate Timerevent
- References:
- More accurate Timerevent
- From: Gert Baars
- Re: More accurate Timerevent
- From: Gert Baars
- Re: More accurate Timerevent
- From: Dirk Claessens
- Re: More accurate Timerevent
- From: Peter Ingham
- More accurate Timerevent
- Prev by Date: Re: More accurate Timerevent
- Next by Date: Re: More accurate Timerevent
- Previous by thread: Re: More accurate Timerevent
- Next by thread: Re: More accurate Timerevent
- Index(es):
Relevant Pages
|