+ 4
[Solved] Why are second increasing very slow?
I made an stopwatch with just "if" statements but the seconds are increasing very slowly. Please help me make the time correct. https://code.sololearn.com/WmxebtrYONWT/?ref=app
4 Réponses
+ 2
Adil Ali
you can change
`ms = ms + Number(1);`
to
`ms = ms + Number(4);`
+ 3
https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#timers
> however, the interval is forced to be at least four milliseconds.
So , the timer will be reset to 4ms even if you set it to 1ms at first
+ 2
How to fix it?
+ 2
Thanks