Interval counter

setInterval runs a callback every delay milliseconds until you clear it.

0

One-shot reminder

setTimeout runs once after the delay. Clear it before it fires to cancel.

Idle — start an interval or schedule a reminder.

Important JavaScript

const id = setInterval(function () {
  ticks = ticks + 1;
}, 1000);

clearInterval(id);

const later = setTimeout(function () {
  status.textContent = "Done.";
}, 1500);

clearTimeout(later);