Cooperative asynchronous JavaScript: Timeouts and intervals
Last updated
Was this helpful?
Last updated
Was this helpful?
For a long time, the web platform has offered JavaScript programmers a number of functions that allow them to asynchronously execute code after a certain time interval has elapsed, and to repeatedly execute a block of code asynchronously until you tell it to stop.
Execute a specified block of code once after a specified time has elapsed.Execute a specified block of code repeatedly with a fixed time delay between each call.The modern version of setInterval()
. Executes a specified block of code before the browser next repaints the display, allowing an animation to be run at a suitable framerate regardless of the environment it is being run in.
Take a look for better understanding about Timeouts and intervals.