Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The update interval of timer display #3096

Closed
dae opened this issue Mar 26, 2024 · 2 comments · Fixed by #3100
Closed

The update interval of timer display #3096

dae opened this issue Mar 26, 2024 · 2 comments · Fixed by #3100

Comments

@dae
Copy link
Member

dae commented Mar 26, 2024

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.

Originally reported on https://forums.ankiweb.net/t/the-update-interval-of-timer-display/42849

Two issues by the looks of it:

  • in reviewer-bottom we use a 1 second timer that's not aligned to when a card is presented
  • the start time is rounded to integer seconds in reviewer.py:780

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?

@AntoineQ1
Copy link
Contributor

Hello !
I'd love to contribute to Anki ; could I suggest the necessary code changes in a PR ?
Sincerely,

@dae
Copy link
Member Author

dae commented Mar 27, 2024

Yes, a PR would be welcome - thank you for the offer.

dae pushed a commit that referenced this issue Mar 31, 2024
* Improve update interval of timer display

Timer calculation frequency increased and aligned with new card apparition.

* Update CONTRIBUTORS

* Update timer interval to 0.333 sec

* Restore timer to 1 sec

- Restoring timer to 1sec value as it is not necessary to increase the frequency.

- Adding a time update directy after new card is displayed so that the timer display immediatly restarts to 0.
@dae dae closed this as completed in #3100 Mar 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants