I was testing the Promise object and wrote some code that simulates a long running task that is synchronous. I was comparing Promise and setTimeout - see fiddle:
<
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.