Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
trafnar
on March 24, 2021
|
parent
|
context
|
favorite
| on:
Comparing Svelte and React
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
on March 24, 2021
|
next
[–]
You 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.
fragile_frogs
on March 25, 2021
|
prev
|
next
[–]
HTTP 203 has a great video about counters (
https://www.youtube.com/watch?v=MCi6AZMkxcU)which
goes into more details about why counters/timers are a bit more complex.
dceddia
on March 24, 2021
|
prev
[–]
Yeah, 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.
Join us for
AI Startup School
this June 16-17 in San Francisco!
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: