title: Timing delay on my PIC
body: <p>Prepare for a nooby question.</p>
  
  <p>I'm writing some ultra-simple code for this new PIC which I've just got. All I'm trying to do is to flash an LED. Below are two code samples - the first works but the second doesn't. Why?? I can't see any problem with the second one.</p>
  
  <p>WORKS:</p>
  
  <pre><code>        while(1)
  {
      i=99999;
      while(i--) {
          LATAbits.LATA0 = 0;  // set RA0 to logic 1
      }
      i=99999;
      while(i--) {
      LATAbits.LATA0 = 1;  // set RA0 to logic 0
      }
  }    
  </code></pre>
  
  <p>DOESN'T WORK:</p>
  
  <pre><code>        while(1)
  {
      LATAbits.LATA0 = 1;  // set RA0 to logic 1
      for(i=0;i&lt;99999;i++) {}
      LATAbits.LATA0 = 0;  // set RA0 to logic 0
      for(i=0;i&lt;99999;i++) {}
  }
  </code></pre>
  
  <p>Thanks in advance for the help!</p>