Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function sleep(ms) {
- return new Promise(resolve => {
- setTimeout(resolve, ms);
- });
- }
- async function asyncForEach(array, client, callback) {
- for (let index = 0; index < array.length; index++) {
- await callback(array[index], client, index, array);
- await sleep(1000);
- }
- client.close();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement