title: How to add a delay to code in C++.
body: <p>I want to add a delay so that one line will run and then after a short delay the second one will run. I'm fairly new to C++ so I'm not sure how I would do this whatsoever. So ideally, in the code below it would print "Loading..." and wait at least 1-2 seconds and then print "Loading..." again. Currently it prints both instantaneously instead of waiting.</p>
  
  <pre><code>cout &lt;&lt; "Loading..." &lt;&lt; endl;
  // The delay would be between these two lines. 
  cout &lt;&lt; "Loading..." &lt;&lt; endl; 
  </code></pre>