HP Forums
Stopwatch functionality - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: Stopwatch functionality (/thread-12369.html)



Stopwatch functionality - KeithB - 02-06-2019 02:50 PM

Is it true that there is not yet a stopwatch for the prime?

Just asking before I try to write one!


RE: Stopwatch functionality - Tim Wessman - 02-06-2019 04:06 PM

It is easy to write. It will not be accurate however.


RE: Stopwatch functionality - StephenG1CMZ - 02-06-2019 04:29 PM

Before you write one...
There is a very simple timer included within my ZIPP program, but it might suffice for timing an event.
http://www.hpmuseum.org/forum/thread-4981.html


RE: Stopwatch functionality - KeithB - 02-06-2019 04:36 PM

(02-06-2019 04:06 PM)Tim Wessman Wrote:  It is easy to write. It will not be accurate however.

Does anyone use a calculator stopwatch for accuracy? 8^)


RE: Stopwatch functionality - KeithB - 02-06-2019 04:39 PM

(02-06-2019 04:29 PM)StephenG1CMZ Wrote:  Before you write one...
There is a very simple timer in my ZIPP program
http://www.hpmuseum.org/forum/thread-4981.html

Thanks.
You might want to include a list of the functionality. I searched the Prime software forum for "stopwatch" and got no hits.


RE: Stopwatch functionality - KeithB - 02-06-2019 04:42 PM

(02-06-2019 04:06 PM)Tim Wessman Wrote:  It is easy to write. It will not be accurate however.

The system date/time must be based on a more accurate RTC. I could do a long term correction based on that.


RE: Stopwatch functionality - cyrille de brébisson - 02-07-2019 06:25 AM

Hello,

Time/Date functions should be relatively accurate. But has a 1s granularity.

Ticks is much less accurate, but has a ~ms granularity.

From memory, both on G1 and G2, any drifts in Ticks should be consistent on a given unit at a given temperature. So, a good strategy would be to:
When user hits start: call ticks.
As time progresses, monitor "time". On a second change, take the ticks...
When the user hits stops, call ticks.
Take the first and last second change ticks. Use it to calculate the number of ticks per second. Do the ratio.

Cyrille


RE: Stopwatch functionality - KeithB - 02-07-2019 07:47 PM

Good idea, thanks Cyrille!