SyntaxFix
Write A Post
Hire A Developer
Questions
You can't (and shouldn't) block processing with a sleep function. However, you can use setTimeout to kick off a function after a delay:
setTimeout
setTimeout(function(){alert("hi")}, 1000);
Depending on your needs, setInterval might be useful, too.
setInterval