Timing in javascript vs real time
<p>I have a question: When I do a countdown in JavaScript, and I have a function of the form:</p>

<pre><code>        &lt;script&gt;
var interval;
var minutes = 1;
var seconds = 5;
window.onload = function() {
    countdown('countdown');
}

function countdown(element) {
    interval = setInterval(function() {
        var el = document.getElementById(element);
        if(seconds == 0) {
            if(minutes == 0) {
                el.innerHTML = "countdown's over!";                    
                clearInterval(interval);
                return;
            } else {
                minutes--;
                seconds = 60;
            }
        }
        if(minutes &gt; 0) {
            var minute_text = minutes + (minutes &gt; 1 ? ' minutes' : ' minute');
        } else {
            var minute_text = '';
        }
        var second_text = seconds &gt; 1 ? 'seconds' : 'second';
        el.innerHTML = minute_text + ' ' + seconds + ' ' + second_text + ' remaining';
        seconds--;
    }, 1000);
}
&lt;/script&gt;
</code></pre>

<p>The time between each one performance of the function is exactly 1 sec. or there is some delay caused by time due to perform body of function?</p>
