frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Why do browsers throttle JavaScript timers?

https://nolanlawson.com/2025/08/31/why-do-browsers-throttle-javascript-timers/
15•vidyesh•1h ago

Comments

BinaryIgor•1h ago
The story of web development:

"For the time being, I’ll just do what most web devs do: choose whatever API accomplishes my goals today, and hope that browsers don’t change too much in the future."

BugsJustFindMe•48m ago
Because browser developers still have major incentive to care about not misusing the resources (cpu/battery) of browser users, and website developers very clearly do not.
cosmic_cheese•12m ago
This the natural course of things when your platform has high capability but low barrier to entry. Conscientious use of resources cannot be assumed and is in fact the exception rather than the rule, and so guardrails must be put in place.
jayflux•30m ago
> Even if you’ve been doing JavaScript for a while, you might be surprised to learn that setTimeout(0) is not really setTimeout(0). Instead, it could run 4 milliseconds later:

Is this still the case? Even with this change? https://chromestatus.com/feature/4889002157015040

swsieber•21m ago
I think it's still the case. The 4ms happens if you call setTimeout nested several times. I don't know the exact limit. But it's 5-ish times where that kicks in IIRC.

Edit: Here's the MDN bit on that, I was correct:

https://developer.mozilla.org/en-US/docs/Web/API/Window/setT...

> browsers will enforce a minimum timeout of 4 milliseconds once a nested call to setTimeout has been scheduled 5 times.

And the link from there to the spec about that:

https://html.spec.whatwg.org/multipage/timers-and-user-promp...

> If nesting level is greater than 5, and timeout is less than 4, then set timeout to 4.

timhh•6m ago
I think that change is talking about the minimum timeout for the first 5 nested calls to `setTimeout(0)`.

Previously the first 5 would take 1ms, and then the rest would take 4ms. After that change the first 5 take 0ms and the rest take 4ms.

jagged-chisel•27m ago
Have I not always heard that timeout-based callbacks always run at or after the timeout, but never before?

“Do this {} at least Xms from now”, right?

nielsbot•9m ago
I remember reading that high precision timers can be used for browser fingerprinting and/or for timing attacks, but I didn't anything specifically about setTimeout()/setInterval() after searching a bit.

Also--loosening the accuracy of timers allows the system to optimize CPU power states and save battery. Again, not sure if that's related here.

Maybe someone else here can add more detail.

timhh•7m ago
I asked about this a few years ago on SO and there is some good info: https://stackoverflow.com/q/61338780/265521

E.g. Chrome has this comment:

  // Chromium uses a minimum timer interval of 4ms. We'd like to go
  // lower; however, there are poorly coded websites out there which do
  // create CPU-spinning loops.  Using 4ms prevents the CPU from
  // spinning too busily and provides a balance between CPU spinning and
  // the smallest possible interval timer.
At the time at least the 4ms only kicks in after 5 levels of nesting, as mentioned in the article, but there was still a 1ms limit before that.

Seems like it has been removed though based on jayflux's comment.

Trump Administration Seeks Pilot Projects for Air Taxis

https://www.nytimes.com/2025/09/12/business/trump-air-taxi-faa.html
1•donohoe•24s ago•0 comments

The Twin Users of the Future – Human and Agents

https://www.shouche.in/blog/the-twin-users-of-the-future
1•shouche•3m ago•0 comments

MoroJS A fast, TypeScript-first API framework (68k req/SEC, AI-ready)

https://morojs.com
1•FluxParadigm•3m ago•1 comments

I made a simple harness for AI-assisted coding

https://github.com/CaliLuke/quality-workflow-meta
1•luckydata•8m ago•1 comments

Pydantic AI Durable Execution

https://ai.pydantic.dev/durable_execution/overview/
2•qianli_cs•8m ago•0 comments

Russians lose internet access as Ukrainian drones hit close to home

https://www.ft.com/content/42b8f467-fc17-4501-aa32-23fd95314a12
5•bookofjoe•9m ago•1 comments

Can you make it to the end of this column?

https://www.economist.com/finance-and-economics/2025/09/11/can-you-make-it-to-the-end-of-this-column
1•petethomas•11m ago•0 comments

Two billionaires have different – and wild – visions of a future in space

https://www.cnn.com/2025/09/12/science/elon-musk-jeff-bezos-oneill-mars-colony
1•Kaibeezy•11m ago•0 comments

Swiss e-ID vote: 'Digitalisation must serve citizens' interests'

https://www.swissinfo.ch/eng/swiss-politics/swiss-e-id-vote-digitalisation-must-serve-citizens-in...
1•giuliomagnifico•11m ago•0 comments

P2 Is the New Papercraft

https://noteflakes.com/articles/2025-09-12-p2-papercraft
1•ciconia•14m ago•0 comments

Paraventricular Thalamus in Alcohol Seeking Rats with Withdrawal

https://www.sciencedirect.com/science/article/pii/S2667174325001326
1•gnabgib•14m ago•0 comments

'Data like you wouldn't believe': the rise of unofficial US economic reports

https://www.ft.com/content/d0d3fa3e-cd43-43db-a4e4-10de2f9ebb88
2•petethomas•15m ago•0 comments

Groundbreaking Brazilian Drug, Capable of Reversing Spinal Cord Injury

https://www1.folha.uol.com.br/internacional/en/scienceandhealth/2025/09/groundbreaking-brazilian-...
3•_aleph2c_•15m ago•0 comments

Show HN: Project Chimera v1.2 – Neuro-Symbolic-Causal AI Agent (Open Source)

https://github.com/akarlaraytu/Project-Chimera
1•aytuakarlar•16m ago•1 comments

Explaining, at some length, Techmeme's 20 years of consistency

https://news.techmeme.com/250912/20-years
1•nhf•16m ago•0 comments

Addison Fischer: Math genius in search for Satoshi

https://satoshi.cv/
1•sandern•16m ago•0 comments

Progressive Delivery Prevents Digital Extinction

https://itrevolution.com/articles/the-netflix-vs-blockbuster-moment-how-progressive-delivery-prev...
1•mooreds•16m ago•0 comments

Turn a spreadsheet into a web app using Django and SQLite MCP [video]

https://www.youtube.com/watch?v=SpdIJuYIe4s
1•kantord•17m ago•0 comments

Opioid Detection Using Smartphone-Based Eye-Scanning

https://www.mdpi.com/1424-8220/25/17/5467
1•PaulHoule•18m ago•0 comments

Inside vLLM: Anatomy of a High-Throughput LLM Inference System

https://blog.vllm.ai/2025/09/05/anatomy-of-vllm.html
1•matt_d•18m ago•0 comments

NASA found signs of alien life on Mars

https://www.cnet.com/science/space/nasa-found-signs-of-ancient-alien-life-on-mars-heres-how-excit...
3•codehamlet•20m ago•1 comments

Ask HN: Are there any modern devices similar to Palm Pilot?

3•butz•23m ago•1 comments

Becoming an algorithmic problem: Resistance in the age of predictive technology

https://www.transformingsociety.co.uk/2025/09/12/becoming-an-algorithmic-problem-resistance-in-th...
2•jomaric•24m ago•1 comments

'We took the gloves off': ex-IDF chief confirms Gaza casualties over 200k

https://www.theguardian.com/world/2025/sep/12/israeli-ex-commander-confirms-palestinian-casualtie...
7•NomDePlum•24m ago•1 comments

Ask HN: Favorite CSS / component framework for web admins?

1•debo_•26m ago•1 comments

From CEO Frustration to AI Revolution: The Promptshelf.ai Story

https://promptshelf.ai/blog/from-ceo-frustration-to-ai-revolution-the-promptshelf-ai-story
1•TalaveraS•27m ago•1 comments

Autonomous robots are much closer than you think

https://www.dwarkesh.com/p/sergey-levine
2•ctoth•28m ago•0 comments

We are in the cancel culture part of the tragedy cycle

https://www.thefire.org/news/we-are-cancel-culture-part-tragedy-cycle
2•timr•29m ago•0 comments

We're building future technologies for the Moon without missed milestones

https://jatan.space/pitfalls-in-lunar-exploration/
2•JPLeRouzic•29m ago•0 comments

Spotify peeved after 10k users sold data to build AI tools

https://arstechnica.com/tech-policy/2025/09/spotify-peeved-after-10000-users-sold-data-to-build-a...
1•mfld•30m ago•0 comments