Skip to content

Instantly share code, notes, and snippets.

@guillefd
Created January 16, 2020 15:32
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 guillefd/9bdc05c8439f0e3070e09d84dbed26c7 to your computer and use it in GitHub Desktop.
Save guillefd/9bdc05c8439f0e3070e09d84dbed26c7 to your computer and use it in GitHub Desktop.
Fake Delay
/**
* Fake a delay
* simulate a time delay and return promise
*
* @private
* @param {number} [duration=3000]
*/
async function fakeDelay(duration = 3000) {
await new Promise(resolve => setTimeout(resolve, duration));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment