Last active
April 20, 2019 16:07
Star
You must be signed in to star a gist
Simple Async Timer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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