2017-06-28 05:02:46 +00:00
|
|
|
<script>
|
2017-06-28 21:39:37 +00:00
|
|
|
async function sleep(delay) {
|
|
|
|
return new Promise(resolve => setTimeout(resolve, delay));
|
|
|
|
}
|
|
|
|
|
|
|
|
async function main() {
|
|
|
|
const roundOne = Promise.all([
|
|
|
|
fetch('fetch-request-a.js'),
|
|
|
|
fetch('fetch-request-b.js'),
|
|
|
|
fetch('fetch-request-c.js'),
|
|
|
|
]);
|
|
|
|
|
|
|
|
await roundOne;
|
|
|
|
await sleep(50);
|
|
|
|
await fetch('fetch-request-d.js');
|
|
|
|
}
|
|
|
|
|
|
|
|
main();
|
2017-06-28 05:02:46 +00:00
|
|
|
</script>
|