Skip to content

Instantly share code, notes, and snippets.

@rpn3319
Last active June 10, 2022 14:07
Show Gist options
  • Select an option

  • Save rpn3319/14dba84ce2dec8680960572916adca6f to your computer and use it in GitHub Desktop.

Select an option

Save rpn3319/14dba84ce2dec8680960572916adca6f to your computer and use it in GitHub Desktop.
nodejs non-blocking promise recursive
async function execute() {
// processing ...
await new Promise((resolve) => {
setTimeout(async () => {
await execute();
resolve();
}, 1000);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment