The update interval of timer display

Sometimes I use the timer (deck option - timer - show answer timer) to monitor how much time I spend in answering a card. However, from time to time I feel that the timer is not very consistent, i.e. it may display different numbers for the same amount of time spent. This is especially obvious when enabling auto advance and “stop timer on answer”: e.g. if I set the “time to reveal answer” as 3.4 seconds, when the answer is revealed the timer may stop at either 00:03 or 00:04.

This problem kinda annoys me (because I use the timer as a reference to choose response, e.g. 00:01=easy, 00:02=good, etc.), so today I decide to actually measure the accuracy of timer by using a stopwatch alongside. See the video below (I’m sorry for the crappy recording, but in-screen recording seem to affect the update frequency of stopwatch…)

Interestingly, it turns out that the timer display always changes at a fixed time in every second (5.24s, 6.24s, 7.24s, 8.24s, 10.24s, 15.24s, 19.24s etc. in the video), and this fixed time (xx.24s) is unrelated to when the card starts to display. Indeed, the timer may stuck at the old number for a while after a new card is displayed but before the next xx.24s arrives (e.g. 14.64s~15.24s in the video).

My theory is that the timer behind the scene is accurate (as the auto answer reveal interval is 3.4s as expected), but the display of timer only updates at the interval of 1s. It leads to the display of timer not consistently related to the actual time spent in answering a card. If the timer shows 00:02 at answer reveal, the actual time spent could be from

1.02s (card display start at x.23s → timer display becomes 00:01 at x.24s → 00:02 at (x+1).24s → answer reveal at (x+1).25s)

to

2.98s (card display start at x.25s → timer display becomes 00:01 at (x+1).24s → 00:02 at (x+2).24s → answer reveal at (x+3).23s)

which has an uncertainty of 2s, instead of the expected 1s. This explains why the same time interval may have different timer display (e.g. 3.4s may correspond to either 00:03 (2~4s), or 00:04 (3~5s)).

So my question: how to (or is it possible at all) to make the timer display update at the actual correct time, either by the in-app settings or by changing the source code?

Note: the “.23” suffix obviously depends on when the stopwatch is started and could be other numbers too; it’s just convenient to illustrate in this way

I’m on kde neon 6.0 (based on ubuntu 22.04) with anki 23.12.1, if that matters.

1 Like

I’ve logged this on The update interval of timer display · Issue #3096 · ankitects/anki · GitHub

2 Likes

Thanks!

We don’t want to increase the update frequency too much, as it will waste CPU cycles, but maybe 0.5 or 0.3 would be enough?

I personally would probably prefer 0.1s (if no better solutions exist except increasing polling rate), though I can understand the concern about CPU usage so its up to yours.

1 Like

relatable. I would show OCD like symptoms if I come across such inaccuracies.