The sample Javascript pause() function below performs a pause for X milliseconds. During the time specified, the browser would appear “frozen” to the user.
Quick reminder: 1000 milliseconds = 1 second, 60000 milliseconds = 1 minute
function pause(milliseconds) { var dt = new Date(); while ((new Date()) - dt <= milliseconds) { /* Do nothing */ } }
Below is a live example, followed by the HTML/Javascript code used.
If you are looking for a way to simply delay execution of code without "freezing" the browser during the wait time, try the Javascript delay() method.