Created
April 23, 2019 14:53
-
-
Save dionyziz/2ba2a18115b4ace9d1dee9a8e761efed to your computer and use it in GitHub Desktop.
This file contains hidden or 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
axios = require('axios') | |
function main() { | |
writeToConsole() | |
makeHttpRequest() | |
} | |
async function writeToConsole() { | |
while (true) { | |
console.log('lol') | |
await sleep(100) | |
} | |
} | |
async function makeHttpRequest() { | |
console.log('making http request') | |
await axios.get('https://dionyziz.com') | |
console.log('made http request') | |
} | |
function sleep(interval) { | |
return new Promise((resolve, reject) => { | |
setTimeout(resolve, interval) | |
}) | |
} | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment