Create new Js function
function sleep(delay) {
var start = new Date().getTime();
while (new Date().getTime() < start + delay);
}
Call the function when you want to delay execution. Use milliseconds in int for delay value.
####Some code
sleep(1000);
####Next line