<div class="box">
<p></p>
<p></p>
<p></p>
<p></p>
<p></p>
</div>
let elements = $('p');
let interval = setInterval(function() {
if (elements.length) {
$(elements.pop()).doSomething();
} else clearInterval(interval);
}, 2000);