title: Is the setInterval() an asynchronous function?
body: <p>I am making a <code>XMLHttpRequest</code> every second to a server, the server will respond with new messages. To call the <code>XMLHttpRequest</code> every second I use the <code>setInterval()</code> function inside of a <code>SharedWorker</code>.</p>
  
  <p>However, since I am making a request every second, I would like to know if <code>setInterval()</code> is asynchronous or not?</p>
  
  <p>For example, if one <code>XMLHttpRequest</code> request took 3 seconds to finish "due to a delay", will I have 3  requests going at the same time or will <code>setInterval()</code> wait until the first request completes before it waits 1 second and send another request?</p>
  
  <p>Here is my code</p>
  
  <pre><code>function checkQueue(url)
  {
    var xhr = new XMLHttpRequest();
    xhr.addEventListener("load", reqListener);
    xhr.open('GET', url, true);
    xhr.send();
  }
  
  
  function reqListener ()
  {
      var queue = JSON.parse(this.responseText);
      notifyAllPorts(queue);
      console.log(this.responseText);
  }
  
  
  setInterval(
      function() {
          checkQueue('/add-ons/icws/push.php') 
      }
  , 1000);
  </code></pre>