The use of setInterval and reference to a counter may be a better solution for you.
(function(){
var count = 0,
upperBound = 3,
intervalTime = 1000,
interval = setInterval(function(){
if (count === upperBound) {
clearInterval(interval);
} else {
console.log(count);
count++;
}
}, intervalTime);
}());
Hope that helps you out!