adding timeout in javascript code example
Example 1: javascript setinterval
setInterval(function() {
//Your code
}, 1000); //Every 1000ms = 1sec
Example 2: javascript settimeout
window.setTimeout(()=>{
console.log('1 second passed!');
}, 1000);