Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const sleep = delay => new Promise(resolve => {
- setTimeout(resolve, delay);
- })
- window.onload = () => {
- sleep(1000).then(async () => {
- await sleep(500);
- console.log('printd after 1500ms');
- })
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement