Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const timeout = (ms) => new Promise(resolve => setTimeout(resolve, ms))
- async function example () {
- console.log('test')
- while (true) {
- console.log('looping')
- await timeout(1000)
- }
- }
- example().catch(console.error)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement