Skip to content

Instantly share code, notes, and snippets.

@patricktargun
Last active April 6, 2020 16:36
Show Gist options
  • Save patricktargun/55c409ea0739fcee813547cb5d7a5611 to your computer and use it in GitHub Desktop.
Save patricktargun/55c409ea0739fcee813547cb5d7a5611 to your computer and use it in GitHub Desktop.
function timeout(ms) {
return new Promise(r => setTimeout(r, ms));
}
var files = [
{ hi: 1 },
{ hi: 2 }
]
async function printFiles () {
for (const file of files) {
const contents = await timeout(3000);
console.log(file);
}
}
printFiles()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment