title: sleep() function from <unistd.h> not executing line by line in C
body: <p>The sleep() function doesn't seem to be respecting line by line compilation in c whenever I run something like this:</p>
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;unistd.h&gt;
  
  int main(){
    int i=0;
  
    while (i!=9){
      printf(&quot;sleep for 1 second&quot;);
      sleep(1);
      i++;
    }
    return 0;
  }
  </code></pre>
  <p>The output ends up being &quot;sleep for 1 second&quot; printed out 10 times after waiting for 10 seconds, instead of the desired one of printing out &quot;sleep for 1 second&quot; every second for 10 seconds.
  Anyone know why this is and how to fix it?</p>