Firstly, setTimeout, lowercase o.
Secondly, as James@ comment said, this is a blocking issue caused by the fact that JS is single threaded and won't resume async code (promises, timeouts, intervals) until it has a free execution cycle. To get around this, you could wrap the later part of your snippet (the while loop) inside an interval. This will give the JS engine to chance to check for ready async code at each iteration of the while
let isDone = false;
setTimeout(() => {
isDone = true;
}, 1000);
let i = 0;
let interval = setInterval(() => {
if (isDone)
clearInterval(interval);
else
console.log(i++);
}, 0);