Returns a promise that resolves after a specified delay.
Can be anything listed in the docs for TimeUnit. Defaults to milliseconds
// do somethingawait sleep(1_000); // wait 1 second// do something elseawait sleep(2, 'hours'); // wait 2 hours// do a final thing Copy
// do somethingawait sleep(1_000); // wait 1 second// do something elseawait sleep(2, 'hours'); // wait 2 hours// do a final thing
Returns a promise that resolves after a specified delay.