Skip to content

Instantly share code, notes, and snippets.

@ilyahuman
Last active November 5, 2020 18:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ilyahuman/97dade213cf77cff5120d75047c2cf7b to your computer and use it in GitHub Desktop.
Save ilyahuman/97dade213cf77cff5120d75047c2cf7b to your computer and use it in GitHub Desktop.
let timerId = setTimeout(function tick() {
timerId = setTimeout(tick, 2000) // here you can pass any timeout and dynamically change next calls
}, 1000);
// Example
let call = 1;
let timerId = setTimeout(function tick() {
timerId = setTimeout(tick, 2000 * call);
call++;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment