Wednesday, January 2, 2013

How to introduce PAUSE or DELAY in JavaScript

I was going through some forums to find out how to introduce pause/delay in the javascript programming

Here is the piece of code I have found which is very useful

    function pause(msec)
    {
            msec += new Date().getTime();
            while (new Date() < msec){}
    }

Thanks for stopping by