title: How can I sync a while loop to time in javascript
body: <p>how could I use javascript make it so that a while loop takes a one - second break in between it's cycles? for example, if I have</p>
  
  <pre><code>var Timer1 = 0;
  var Timer2 = 0;
  var Timer3 = 0;
  
  While (Timer1 &lt; 257)
  {
      Timer1++;
      if (Timer1 = 256)
      {
      Timer2++;
      Timer1 = 0
      }
      if (Timer2 = 256)
      {
      Timer3++;
      Timer2 = 0
      }
      if (Timer3 = 256)
      {
      Timer1 = 257;
      Timer3 = 0;
      console.log("All Done!")
      }
  }
  </code></pre>
  
  <p>How could I make it so that the loop takes a second in between the time when it's done with the if statements and when the while loop runs again?</p>