title: Which is the fastest way to loop? [for curiosity]
body: <p>I'm trying to increase a variable from 0 to 1000000 in a fastest way. In this case i need to increase the variable value and measure the time to run all of this loops. Should i use a <code>while</code> loop, or a <code>setInterval()</code> with <code>0</code> of time interval is fastest?</p>
  
  <pre><code>var i = 0;
  while(i &lt;= 1000000){
    i++;
  }
  
  //VS
  
  var i = 0;
  setInterval(function(){
    if(i &lt;= 1000000){
      i++
    }
  },0)
  
  //OTHER OPTIONS
  //...
  </code></pre>
  
  <p>And how to measure that?</p>
  
  <p>UPDATE</p>
  
  <p>I think I expressed myself wrong, I want to actually reach 1 million by adding one by one to the variable. And thats my issue in measuring that, wich is the best way?</p>