Pause all javascript
<p>I have been working on writing a library of code for my future projects. One of the functions I've been working on is a pause function. So far I have no problem with the errors reporting that the script is running to long even on pauses as long as 10 seconds. This is to primarily keep <strong>malicious users</strong> busy, it works well when you set a very long time. I was wondering if there are any errors that I should look out for that I might face?
Here's the code...</p>

<pre><code>pause = function(a) {
    var b = new Date().getTime();
    e = false;
    function wait() {
    d=10;
    for(i=0;i&lt;d;i++) {
        d++;
        var c = new Date().getTime();
        if(c-b&gt;=a) {
            e = true;
            break;
        }
        if(d&gt;1000000) {
            break;
        }
    }
}
wait();
if(e==false) {
    pause(a-(new Date().getTime()-b));
}};
</code></pre>
