title: progress bar in for loop
body: <p>I need a progress bar in a for loop in javascript</p>
  <pre class="lang-js prettyprint-override"><code>for(index=0; index &lt; 1000; index++){
      // set progress bar value to  index/1000 * 100 + '%'
  }
  </code></pre>
  <p>I notice we can put it in a <code>setInterval</code> function, but it will cost more time to run the for loop.</p>
  <p>So is there any way to run the for loop and generate the progress bar without cost more time?</p>