4 ms·
Is it necessary to use a worker for the timer? If you just record the start time, then inconsistent setTimeout calls aren't a problem because each call calculat
by trafnar 6y ago
Is it necessary to use a worker for the timer? If you just record the start time, then inconsistent setTimeout calls aren't a problem because each call calculates the duration from start time to current time. Or am I missing something?
- akdor1154 6y agoYou can work out that your 25 minute timer actually took 30 minutes this way, but you can't fix it to make it actually take 25 minutes.
- dceddia 6y agoYeah, but I think putting it in the worker was about making the timer able to “go off” at a specific time, while the page is backgrounded.
- fragile_frogs 6y agoHTTP 203 has a great video about counters (https://www.youtube.com/watch?v=MCi6AZMkxcU)which https://www.youtube.com/watch?v=MCi6AZMkxcU)which goes into more details about why counters/timers are a bit more complex.