Why does the Promise object block rendering?

while (Date.now() - nu < 1000) {} doesn’t simulate a long running task that is syncronous. It is a long running task that is syncronous.

Promises are a way to manage asynchronous code, not a way to make code asynchronous, nor a way to simulate multithreading.

For that, you need to look at workers.

Leave a Comment