Comments (6)
Good discovery. I will improve this soon.
from vue-countdown.
Thanks for making this change so quickly.
However, when comparing to various physical stopwatches over 7 minutes I am finding that the countdown *still* lags behind real time.
Have you tried this type of testing?
from vue-countdown.
As a browser-side count down component, I think it is hard to be accurate as a physical stopwatch. I guess it may have a deviation of ±0.5s per minute (±8ms per step) when using the window.requestAnimationFrame
function.
from vue-countdown.
Do you think it would be a good idea to have a way of not using window.requestAnimationFrame
(and instead defaulting to setTimeout()
)?
from vue-countdown.
from vue-countdown.
Hi. We observe that the library still produces a time error that becomes clearly noticeable after an hour of work, the error seems to depend on tab activity.
In my humble opinion the core of the timing issue is actually here:
progress() {
this.totalMilliseconds -= this.interval;
The library decrements the totalMilliseconds
by a fixed interval value not accounting for the real time that tick took which can be off from the requested time by few milliseconds depending on stuff like CPU load - those milliseconds slowly accumulate over time.
I think what would be conceptually correct here is:
progress() {
this.totalMilliseconds = this.endTime - Date.now();
That way we would eliminate the time error by making totalMilliseconds
to get decremented by the effective time that tick took rather than the time that we requested from the unreliable OS.
from vue-countdown.
Related Issues (20)
- Does not work on Nuxt HOT 2
- Vue 3 compatibility HOT 4
- Does not work with disabled options api HOT 1
- update not working HOT 1
- can support vue 2.x? HOT 1
- README still mentions a `dist` directory that no longer exists
- Why pause and continue methods are not public ? HOT 1
- Is it possible to make the `handleVisibilityChange` listener as prop option ? HOT 1
- How to show only hours ? HOT 2
- [fature-request] Add a restart method HOT 6
- Is it possible to show 1/10th of seconds or 1/100th of seconds? HOT 1
- [Feature Request] Add universal support for vue 2.7.x + 3.x HOT 2
- How can I get the totalSeconds data in the @progress event? HOT 1
- restart the countdown HOT 2
- Custom Interval error HOT 1
- How to stop the count ? HOT 1
- How to create count up HOT 1
- 5690.11.0.
- Does this library emit an event when countdown finish? HOT 1
- auto-start does not work with Composition API HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vue-countdown.