+ 3
Problem with 1ms setInterval [SOLVED]
I am working on a project created by golden rockstar and when I tried to make a simple stopwatch with the setInterval it didnt work. let me explain a bit. if I write setInterval(function,1000) it let it work every second, so if 1000 = 1s, 1 had to be 1ms, but it worked waaaay to slow, and now to let it work more accurate I have to add 4.5222222 milliseconds every millisecond? is it a local problem or not (my wifi is not good enough to search google since Ive got an internet problem) https://code.sololearn.com/WaS5BRKDLZEi/?ref=app
5 Answers
+ 1
For JavaScript, setInterval timer should be 10msec or above.
You go around by making multiple setInterval to achieve 1msec timer.
https://code.sololearn.com/W5pfer3My6pP/?ref=app
+ 1
Your stopwatch works slowly
+ 1
In addition, How to charge the phone?
+ 1
and, can you add phone_modes (ringer, vibrer, silent)
0
CalviŐ˛ Very much thanks, I didnt know that a 1ms timer was not possible using only 1 interval
Sousou the phone charges itself (js line 53-113)
Sousou I am gonna work on that (for example for the timer when finished) but its gonna take a while and it wont ring or vibrate if you set your real device silent