Tag

setTimeout

0 views collected around this technical thread.

Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
May 12, 2025 · Frontend Development

Understanding Browser Rendering, Event Loop, and Techniques to Avoid Page Jank When Adding Massive DOM Elements

This article explains the underlying browser mechanisms that cause page jank when creating millions of DOM elements, analyzes the event loop, rendering pipeline, macro‑ and micro‑tasks, and presents practical solutions such as setTimeout, requestAnimationFrame, MessageChannel, and requestIdleCallback to keep the UI responsive.

DOMEvent LoopJavaScript
0 likes · 16 min read
Understanding Browser Rendering, Event Loop, and Techniques to Avoid Page Jank When Adding Massive DOM Elements
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Dec 12, 2024 · Frontend Development

Understanding JavaScript setTimeout and setInterval and Implementing setInterval Using setTimeout

This article explains the fundamentals and execution order of JavaScript's setTimeout and setInterval functions, discusses their parameters and return values, demonstrates why setTimeout is asynchronous, shows how to cancel timers, and provides a custom recursive setTimeout solution that mimics setInterval behavior.

JavaScriptTimerfrontend
0 likes · 12 min read
Understanding JavaScript setTimeout and setInterval and Implementing setInterval Using setTimeout
Sohu Tech Products
Sohu Tech Products
Oct 18, 2024 · Frontend Development

Improving Long-Running JavaScript Tasks with scheduler.yield in Chrome 129

Chrome 129’s new scheduler.yield() lets developers pause long‑running JavaScript loops without the 4 ms minimum delay or queue‑end placement of setTimeout(), cutting execution time from ~17 s to ~5.6 s while keeping the page responsive and preserving task priority.

ChromeFront-endJavaScript
0 likes · 10 min read
Improving Long-Running JavaScript Tasks with scheduler.yield in Chrome 129
58 Tech
58 Tech
May 26, 2022 · Frontend Development

Advanced Timer Techniques in Frontend Development

This article examines the challenges of timer precision in front‑end scenarios such as e‑commerce flash sales, explains the limitations of native setInterval and setTimeout, and introduces a frame‑based timer using requestAnimationFrame, requestIdleCallback and compensation strategies to achieve high‑accuracy scheduling.

JavaScriptfrontendperformance
0 likes · 19 min read
Advanced Timer Techniques in Frontend Development
Fulu Network R&D Team
Fulu Network R&D Team
Aug 10, 2021 · Frontend Development

Implementing Zero-Delay Timers in JavaScript: Alternatives to setTimeout

This article explores why the native setTimeout cannot achieve a true 0 ms delay, presents a postMessage‑based zero‑timeout implementation, and compares several asynchronous JavaScript techniques—including queueMicrotask, async/await, and MessageChannel—showing their performance advantages over setTimeout.

JavaScriptMessageChannelmicrotask
0 likes · 7 min read
Implementing Zero-Delay Timers in JavaScript: Alternatives to setTimeout
Laravel Tech Community
Laravel Tech Community
Aug 25, 2020 · Frontend Development

Why You Should Avoid Using setInterval in JavaScript

Using setInterval for repeated tasks in JavaScript can lead to unhandled errors, ignore network latency, and provide no guarantee of execution timing, causing request overloads and missed intervals; replacing it with setTimeout and dynamic scheduling ensures more reliable, controlled, and error‑resilient timing behavior.

JavaScriptfrontendperformance
0 likes · 5 min read
Why You Should Avoid Using setInterval in JavaScript
Qudian (formerly Qufenqi) Technology Team
Qudian (formerly Qufenqi) Technology Team
Jan 17, 2017 · Frontend Development

Why requestAnimationFrame Beats setTimeout for Smooth Animations – A Deep Dive

An in‑depth investigation compares requestAnimationFrame and setTimeout for web animations, revealing how the former syncs with browser repaint cycles, why it outperforms setTimeout, the limits of manually adjusting frame rates, compatibility issues across browsers and platforms, and practical fallback implementations.

animationfrontendperformance
0 likes · 9 min read
Why requestAnimationFrame Beats setTimeout for Smooth Animations – A Deep Dive
Hujiang Technology
Hujiang Technology
Dec 22, 2016 · Frontend Development

Understanding JavaScript Timers, the Event Loop, and setTimeout Execution

This article explains how JavaScript’s execution stack, heap, event loop, and setTimeout work together, illustrating their behavior with visual diagrams and examples that reveal common pitfalls such as blocking code and minimum timer delays.

Event LoopJavaScriptasynchronous
0 likes · 8 min read
Understanding JavaScript Timers, the Event Loop, and setTimeout Execution