Last active
April 17, 2020 08:27
-
-
Save koyanloshe/108a05d99f25fe2e79d966eb2afa9d9b to your computer and use it in GitHub Desktop.
Generate multiple requests #Javascript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const {promisify} = require('util') | |
const sleep = promisify(setTimeout) | |
const request = async(data) => { | |
let time = Math.random() * 1000 | |
await sleep(time) | |
return {data, time} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment