setTimeout(function(){
location.reload();
}, 3000); //run this after 3 seconds
setTimeout(function() {
//whatever you want to execute
}, amountOfSeconds * 1000); //executes after amountOfSeconds seconds
//with defined function
setTimout(functionName, amountOfSeconds * 1000);
//example
setTimeout(function() {
console.log("It has been 3 seconds.");
}, 3000);
setTimeout(function () {
console.log('Hello world')
}, 1000)
setTimeout(() => {
console.log('Foo bar')
}, 1000)
Run code snippet
function closeAnimation() {
setInterval(function(){hide()}, 400);
clearInterval(stopAnimation);
}
var stopAnimation = setInterval({hide()}, 400);