Consider this:
setTimeout(function(){...}, 1000);
It runs the function after 1 second. I was confused