Coder Social home page Coder Social logo

Timer skips seconds about timer-app HOT 3 CLOSED

michaelvillar avatar michaelvillar commented on May 14, 2024
Timer skips seconds

from timer-app.

Comments (3)

luckman212 avatar luckman212 commented on May 14, 2024

I noticed this too - I was poking around in the source to try to figure out why this was happening. Something related to Foundation.Timer.scheduledTimer(timeInterval maybe?

from timer-app.

robinstewart avatar robinstewart commented on May 14, 2024

When I was making the app more energy efficient, I made sure that the UI is only updated once per second. I think what may be happening is that in the unusual case where you happen to start the countdown very close to the seconds boundary, you could get an update at, say 8.99 seconds and then at 8.01 seconds, which would both show as "8".

Note the Foundation repeating timers don't "drift" -- you don't get 8.99 then 7.95 then 6.91, then 5.86. It's just an issue of variance around the boundary where you might get 8.99 then 8.01 then 6.99 then 6.01.

This implies the fix is to make sure the repeating timer starts safely away from a boundary -- to make sure you get updates at for example 9.09, 8.11, 7.08, 6.10, 5.09 (the variance doesn't affect the significant digit).

from timer-app.

luckman212 avatar luckman212 commented on May 14, 2024

Fix #94 looks good.

from timer-app.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.