Advertisement
osx11

[JS] Sleep

Mar 9th, 2019
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. sleep(time).then(() => {
  2.     // .. do sth
  3. });
  4.  
  5. function sleep (time) {
  6.     return new Promise((resolve) => setTimeout(resolve, time));
  7. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement