Guys my mind is breaking over this 25 + 5 Clock project

Here is the link to my pen :

I simply do not know what the problem seems to be. The error message I get from the test suit isn’t really helpful to me.

Can someone please give me a hint or direction to where I should put my thinking into ?
I somehow figured that setInterval() seems to be pretty inaccurate but the solutions to have a accurate timer are so overkill(at least it seems to me).

The problem is that you decrement running time and only after a second you change the status label. Tests want for it to happen simultaneously. So you should check if new time is “00:00” then you not only update sessionMinutes/seconds, but also timerLabel and isSession.

1 Like

I don’t underdstand quiet. Isn’t that exactly what I am doing ? when I check if sessionSeconds and sessionMinutes are “00” then I change the timer label. and isSession

No, you’re setting minutes/seconds to “00” and on the next interval you’re setting the label.
Start the timer and observe - it reaches “00:00” and after one second the label changes.

1 Like

oh boy I think I have to rewrite the whole function because it became way to complicated to debug. but thank you for the hint. I’ll try to keep that in mind.

Ok i don’t know how to thank you but I rewrote my setTime-Method and now it worked with your hint.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.