I need to pause a while loop for a certain amount of time based on a condition
var i = 2
while (i) {
if (i == 2) {
//pause loop for 5 seconds
//execute function1();
} else {
//pause loop for 4 seconds
//execute function2();
}
}
How could I achieve this. Thank you