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

Time in seconds is off #43

Open
tforward opened this issue Jun 4, 2018 · 4 comments
Open

Time in seconds is off #43

tforward opened this issue Jun 4, 2018 · 4 comments

Comments

@tforward
Copy link

tforward commented Jun 4, 2018

Starting a timer and noticing the time in seconds skips sometimes. Like in a 25 min timer
[25:58, 25:57] and 25:59 is missing. Also have had 25:58 missing and 25:59 showing.

Sometime will repeat the same number in general overtime

`function displayTime(timer) {
const currentTime = timer.msToTimecode(timer.lap());
// console.log(timer.msToTimecode(timer.lap()));
const timeMMSS = currentTime.substring(3, 8);
console.log(currentTime);
}

function getTimer() {
const timer = new Tock({
countdown: true,
interval: 1000,
callback: displayTime
// complete: someCompleteFunction
});
return timer;
}`

@tforward
Copy link
Author

tforward commented Jun 4, 2018

I played around with the example file in Tock and it looks like it does not support 1 second (1000ms) ticks, because of rounding it won't be accurate, and you have to use a smaller tick like 250ms for it to work correctly.

@mrchimp
Copy link
Owner

mrchimp commented Jun 5, 2018

Thanks for raising the issue. I'll try to find some time to look into it. It seems strange that it would have problems with 1s ticks as it's all measured in ms... Is it only 1000ms exactly that causes the issue, or times over a certain amount?

@tforward
Copy link
Author

tforward commented Jun 5, 2018 via email

@robatwilliams
Copy link

Looking at the count up example, it skipped 2:08.

Log:

Tick 126987ms
Tick 127988ms
Tick 129003ms
Tick 130006ms

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

No branches or pull requests

3 participants