Skip to content

Instantly share code, notes, and snippets.

@rafaelmaeuer
Created December 29, 2023 11:31
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 rafaelmaeuer/35234f8d5ba967c2a522b4a1ba0a532b to your computer and use it in GitHub Desktop.
Save rafaelmaeuer/35234f8d5ba967c2a522b4a1ba0a532b to your computer and use it in GitHub Desktop.
var sleepSetTimeout_ctrl;
function sleep(ms) {
clearInterval(sleepSetTimeout_ctrl);
return new Promise(resolve => sleepSetTimeout_ctrl = setTimeout(resolve, ms));
}
await sleep(<duration>);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment