This is my code
var count = 1;
for (var key in result.data) {
if (count == 10) {
// I want to delay 1 second here
}
var value = result.data[key];
generate(key, value);
count++;
}
As you see , I iterate throught result.data
, and added count
to determine when to add delay.
I just want to add 1 second delay inside this loop when count == 10
as I shown .