Scheduling: setTimeout and setInterval thumbnail
Scheduling: setTimeout and setInterval
javascript.info
setTimeout allows us to run a function once after the interval of time. setInterval allows us to run a function repeatedly, starting after the interval of time, then repeating continuously at that interval. If the first argument is a string, then JavaScript creates a function from it. The first line
5 Users
0 Comments
45 Highlights
0 Notes

Top Highlights

  • setTimeout allows us to run a function once after the interval of time. setInterval allows us to run a function repeatedly, starting after the interval of time, then repeating continuously at that interval.
  • If the first argument is a string, then JavaScript creates a function from it.
  • The first line “puts the call into calendar after 0ms”. But the scheduler will only “check the calendar” after the current script is complete,
  • The HTML Living Standard says: “after five nested timers, the interval is forced to be at least 4 milliseconds.”.
  • few times with zero-delay, and afterwards with 4+ ms delay.

Ready to highlight and find good content?

Glasp is a social web highlighter that people can highlight and organize quotes and thoughts from the web, and access other like-minded people’s learning.