Tag

setInterval

0 views collected around this technical thread.

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
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.

JavaScriptPerformancefrontend
0 likes · 19 min read
Advanced Timer Techniques in Frontend Development
php中文网 Courses
php中文网 Courses
Feb 14, 2022 · Frontend Development

Creating a Baidu Homepage “Yuanxiao Festival Tangyuan” Animation with JavaScript setInterval

This tutorial demonstrates how to recreate Baidu’s Yuanxiao Festival “Tangyuan” animation by using a sprite image and JavaScript’s setInterval to repeatedly shift background positions, providing complete HTML, CSS, and JavaScript code for both forward and reverse animation effects.

CSSJavaScriptanimation
0 likes · 5 min read
Creating a Baidu Homepage “Yuanxiao Festival Tangyuan” Animation with JavaScript setInterval
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.

JavaScriptPerformancefrontend
0 likes · 5 min read
Why You Should Avoid Using setInterval in JavaScript