why settimeout blocks eventloop

前端 未结 1 1650
小蘑菇
小蘑菇 2020-12-10 08:07

Note: this is not a replicated post for those about settimeout, the key answer here is browser design options.

I am starting study node.js: A simple example to test

相关标签:
1条回答
  • 2020-12-10 08:30

    It's the browser waiting, not node.js

    If you run the server and request http://localhost:8080/ in two tabs it takes 20 seconds because the browser waits for the first request to the same url before starting the second.

    If you run the server and request http://localhost:8080/1 and http://localhost:8080/2 in two tabs it takes 10 seconds again.

    0 讨论(0)
提交回复
热议问题