Skip to content

Technology Quote by Eric Freeman

“When you pass zero to setTimeout, you’re asking JavaScript to run your timeout handler as soon as it possibly can — and this leads to your handler running as frequently as it possibly can.” quote by Eric Freeman
Download Open image
““When you pass zero to setTimeout, you’re asking JavaScript to run your timeout handler as soon as it possibly can — and this leads to your handler running as frequently as it possibly can.””

Eric Freeman

About This Quote

Source Talk: JavaScript Performance, 2015

Setting zero delay in setTimeout causes the callback to execute as fast as the event loop permits, often leading to excessive, uncontrolled executions.

In simple terms: Zero delay makes the function run as often as possible.

Key Takeaway

Avoid zero delay; use requestAnimationFrame or throttling.

Themes

performance asynchronous event loop

Mood

cautious analytical

Type

technical advisory

When to use this quote

  • UI animations
  • data polling
  • real‑time updates
  • debounce implementations

Key Concepts

JavaScript timing throttling

Questions to Reflect On

  • Do you need that frequency?
  • Could a lower frequency suffice?
A Different Perspective

Zero delay can still block the main thread and cause jank.

2.3 out of 5 (6 ratings)

More by Eric Freeman

Explore all 90 Eric Freeman quotes

More Technology quotes

Browse all 12,247 Technology quotes