setTimeout or setInterval?
<p>As far as I can tell, these two pieces of javascript behave the same way:</p>

<p><strong>Option A:</strong></p>

<pre><code>function myTimeoutFunction()
{
    doStuff();
    setTimeout(myTimeoutFunction, 1000);
}

myTimeoutFunction();
</code></pre>

<p><strong>Option B:</strong></p>

<pre><code>function myTimeoutFunction()
{
    doStuff();
}

myTimeoutFunction();
setInterval(myTimeoutFunction, 1000);
</code></pre>

<p>Is there any difference between using <a href="https://developer.mozilla.org/en/window.setTimeout">setTimeout</a> and <a href="https://developer.mozilla.org/En/window.setInterval">setInterval</a>? Which do you use and why?</p>
