Skip to content

Instantly share code, notes, and snippets.

@Nymphium
Last active May 7, 2020 17:33
Embed
What would you like to do?
environment
OS ArchLinux
Mem 16GB
CPU intel Core i7 8565U
$ time node hoge
hello
!
world
node hoge  3.87s user 0.26s system 120% cpu 3.422 total
async function f() {
const p = new Promise(resolve => setTimeout(() => {
console.log("hello");
resolve();
}, 2000));
for(let x = 0; x < 5000000; x++) {
setTimeout(() => {}, 10);
}
setTimeout(() => console.log("world"), 1000);
await p;
console.log("!");
}
f()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment