Malleys,
ок, спасибо за науку, но проще один setTimeout, без while, await, Promise ...
<div id="test"></div>
<script>
var counter = 0;
(function delay(duration) {
test.textContent = counter;
if(++counter <= 100) setTimeout(delay, duration, duration);
})(500)
</script>