title: Why is the sleep function being executed before anything?
body: <p>When i execute the code below the sleep function executes before both print statements.</p>
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;unistd.h&gt;
  
  int main(void) {
  
    printf(&quot;before\n&quot;);
  
    sleep(4);
  
    printf(&quot;after&quot;);
  
    return 0;
  
  }
  
  </code></pre>
  <p>So instead of: <code>before -&gt; *waits 4 seconds* -&gt; after</code><br />
  It performs: <code>*waits 4 seconds* -&gt; before -&gt; after</code></p>