Accuracy of Stopwatch

All discussions here

Accuracy of Stopwatch

Unread postby mikewest » Mon Apr 26, 2010 5:48 pm

Hi,

So, I'm curious as to the accuracy of the timing in XNote. I see that the process and thread are given high priorities, but what is the basis for tracking time? My understanding is that PC clocks are designed to be kinda accurate, but no where near a high performance, dedicated timing device.

Does the stopwatch lose time based on what the PC is doing?

Thanks,
Mike
mikewest
 

Re: Accuracy of Stopwatch

Unread postby mikewest » Wed Apr 28, 2010 4:42 am

I went ahead and started a stopwatch along with XNote. I took splits at the same time on both.
Stopwatch is Robic handheld.
XNote is running on a 10 year old computer running Windows Home Server. It might have done a backup sometime during the test.
Here's what I got after about 12 hours:

Start at 9:50 AM

Xnote Stopwatch
00:00:09.05 00:00:09.06
00:43:32.03 00:43:32.30
07:39:38.22 07:39:40.73
11:37:22.99 11:37:26.80

So, XNote can certainly drift over time (about 1/4 sec an hour in this case) depending on the computer hardware, what the computer is doing etc......
mikewest
 

Re: Accuracy of Stopwatch

Unread postby Stopwatch » Wed Apr 28, 2010 10:33 am

XNote gets current time value with Windows API's timeGetTime. Windows through series of internal calls gets time value from system timer (actually from internal counter incremented by every system timer's interrupt). Unfortunately modern High Precision Event Timer are not supported by Windows until Vista.

mikewest wrote:So, XNote can certainly drift over time (about 1/4 sec an hour in this case) depending on the computer hardware, what the computer is doing etc......

Computer's workload influences only on the time splitting. The cause of drift you observed is the computer's hardware. If you want we might experiment with different Windows API calls in hope some of them use different hardware timers and techniques.
Stopwatch
Site Admin
 
Posts: 421
Joined: Thu Feb 19, 2009 6:25 pm

Re: Accuracy of Stopwatch

Unread postby mikewest » Thu Apr 29, 2010 11:19 pm

So, it seems that
1.the hardware clock is the master timekeeper.
2.doing splits then takes some processor time, which depending on the workload of the computer, may be delayed or "off".
3. highly accurate time from the hardware is in later versions of windows.

I think this is fine. It makes sense. The drift that i see is the hardware clock, then. I need _relative_ times, not really absolute times. I can do computer intensive operations as long as I don't try to take any splits during that time.

Sounds good.

Thanks,
Mike
mikewest
 

Re: Accuracy of Stopwatch

Unread postby Stopwatch » Fri Apr 30, 2010 7:42 am

Yeah, right!
Now I'm studying how to access HPET directly bypassing Windows.
Stopwatch
Site Admin
 
Posts: 421
Joined: Thu Feb 19, 2009 6:25 pm

Re: Accuracy of Stopwatch

Unread postby mikewest » Sat May 01, 2010 12:36 am

I just performed another test with a newer laptop (Toshiba m200)

XNOTE: Robic Stopwatch
00:00:09.95 00:00:10.10
00:12:36.08 00:12:36.13
01:22:46.20 01:22:46.32
01:24:17.68 01:24:17.90
01:27:34.60 01:27:34.95
10:44:14.83 10:44:15.59
18:15:40.70 18:15:41.83
mikewest
 

Re: Accuracy of Stopwatch

Unread postby mikewest » Sat May 01, 2010 1:05 am

I have done two simple tests with 3 clocks, ancient PC, old PC, and my handheld Robic stopwatch. I would suspect that the Robic stopwatch is the best because it is dedicated to being a stop watch while the PCs are just computer clocks. I don't know though.

I thought about it for a while. What we do for Bicycle Time Trials is that we set all stopwatches and the start clock (one of these: http://www.electronumerics.com/raceclock_lm.htm) about 1/2 hour before the first rider is off to the same time. Then the judges go to the finish line (typically 1/4 to 1/2 mile away) and record the finish times of the riders who go about a total of 10-15 miles based on their stopwatch. So, if the start clock is bang on, but the computer clock that we use to find the finish time is "slow" or looses time, then the last rider gets a small "bonus". (I think I got the signs all right. :) )

But I have no idea which clocks are accurate and which ones are off by a bit. At this point, I think it really isn't important..... Until we have a National Event. ;)

Thanks,
Mike
mikewest
 

Re: Accuracy of Stopwatch

Unread postby Stopwatch » Mon May 03, 2010 5:48 pm

This build uses QueryPerformanceCounter which might utilize HPET (... may make use of RDTSC, but might instead make use of a timing devices on the motherboard or some other system services that provide high-quality high-resolution timing information).

Try out how it behaves.

xnsw.zip
Use of HPET
(166.04 KiB) Downloaded 1370 times
Stopwatch
Site Admin
 
Posts: 421
Joined: Thu Feb 19, 2009 6:25 pm

Re: Accuracy of Stopwatch

Unread postby mikewest » Fri May 07, 2010 4:31 pm

So, this might be the only software project that I have ever seen where the feedback is incorporated so quickly. Wow.

I've got a road race Saturday (no timing, just a finishlynx camera for the pack of 40 riders going by in 4 seconds at the finish). I'll try the build on my

ancient computer (Asus P2F-B motherboard)
old laptop (Toshiba m200)
current desktop (some sort of Intel motherboard)

along with a couple of stopwatches that I have lying around.

I suppose I could also time against an atomic clock (my gps) and see what kind of drift i get, although the gps only has seconds resolution. But it should be VERY consistent

thanks,
mark
mikewest
 

Re: Accuracy of Stopwatch

Unread postby JanHgm » Wed May 12, 2010 6:01 pm

Interesting discussion.

And if you are using a Finishlynx I expect that this is a line scan camera just as they are using in athletics.
You might be interested in the last development I made for athletics events using xNote a 30 fps IP camera and screen recording with Camstudio.

For this events I asked national committee how they verify that recording is accurate. Did not get an answer from the national organization but one of the time system vendors told me that the committees do not know how to verify measurement accuracy. They just believe what vendors tells them he said.

Some comments about your accuracy. With a race the start is give with a gun shot. Each 34 cm that the start sensor is away is a delay of 0,001 second.
Mostly athletics are some meters away so delay for them is more than 0,01 second.

So if you start a discussion about measurement and accuracy you have to take many other conditions in account as well.

Jan
JanHgm
 
Posts: 31
Joined: Sun Apr 12, 2009 10:52 am
Location: Almere, The Netherlands

Next

Return to Main forum

Who is online

Users browsing this forum: No registered users and 9 guests

cron