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

Improve timer interval display (#3096) #3100

Merged
merged 6 commits into from Mar 31, 2024

Conversation

AntoineQ1
Copy link
Contributor

To improve the displayed timer accuracy, I carried out the following changes :

  1. The frequency of the timer has been updated from 1.0 second to 0.3 second
  2. The timer is reset with each new card

Resolves #3096

Timer calculation frequency increased and aligned with new card apparition.
@dae
Copy link
Member

dae commented Mar 29, 2024

Thank you!

Minor thought: how about 333 as the delay, so that the timer ends up getting updated as close to a second as possible?

@AntoineQ1
Copy link
Contributor Author

You're welcome :)

Great idea, I just updated the code accordingly !

@dae
Copy link
Member

dae commented Mar 30, 2024

Sorry, I feel silly for not thinking of this earlier, but do we even need to increase the timer resolution? Since you're starting the timer as the question is shown now, perhaps we could simply refresh every 1000ms after that?

- 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.
@AntoineQ1
Copy link
Contributor Author

No problem ! Indeed, after some tests, it seems it's not necessary.
Also, it helped me discover that the timer didn't reset to 0 immediatly when a new card was displayed (I didn't see it before because it was only 0.3 / 0.333 seconds later), so I added a time update just after the new question is shown to account for that.

@dae
Copy link
Member

dae commented Mar 31, 2024

Great - thanks again!

@dae dae merged commit 32c1296 into ankitects:main Mar 31, 2024
1 check passed
@AntoineQ1 AntoineQ1 deleted the issue-3096-timer-interval branch April 2, 2024 16:04
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 this pull request may close these issues.

The update interval of timer display
2 participants