Skip to content

Instantly share code, notes, and snippets.

@dtothefp
Last active April 20, 2019 16:07
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save dtothefp/d6808778647b9fdf30d6f3731c51c8c4 to your computer and use it in GitHub Desktop.
Simple Async Timer
const wait = (duration = 100) => new Promise((res) => setTimeout(res, duration));
export default async (duration = 500) => {
console.log('Wait for: ', durtaion);
await wait(duration);
console.log('Finished after: ', durtaion);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment