Giter Club home page Giter Club logo

Comments (4)

kaimys avatar kaimys commented on June 6, 2024

And when you switch to an other tab it counts with half speed. It looks like that the time shown is also depending on the script run time. It should be synced to the system time.

from flipclock.

frimik avatar frimik commented on June 6, 2024
  • Try adding an alert("foo"); in your javascript Console. Counter will pause and resume afterwards.
  • Try adding tons of flipclocks to one and the same page - the mere "load" of rendering all of these will cause several seconds of drift per minute.

In my case, I wanted to use it for counting down a lot of things... I think what's needed is for the countdown to instead of simply "counting" down 1 at a time, it needs to keep track of the target Date where it should reach 0.

from flipclock.

sskrla avatar sskrla commented on June 6, 2024

Why is this closed? I was about to open a similar issue as it is very much a problem for my application.

If the computer / browser is suspended the timer will be effectively paused. If you switch tabs, intervals are apparently slowed or at least scheduled with extremely low priorities. Which causes considerable drift over even a few minutes.

I am still looking at the code, but I suspect this is because Face depends on the interval being called exactly every second and setInterval makes no assurances of this. I will most likely be writing a custom face that adjust the counters according to the delta between timer start and now.

from flipclock.

KyleBastien avatar KyleBastien commented on June 6, 2024

@sskrla You can see issue #155 for a discussion (and a possible workaround) for what your experiencing.

from flipclock.

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.