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.
- Web Workers for browsers.
- Worker Threads for Node.js.