title: time delay between 2 lines of code in javascript, not settimeout
body: <p>is there a function that would add a time delay between 2 lines of code.  Not the settimeout, because settimeout requires a function/object in its arguments.</p>
  
  <p>I am looking for something like this pseudo code</p>
  
  <pre><code>write "abc";
  delay(500);
  write "xyz";
  </code></pre>
  
  <p>TIA</p>
  
  <p>Edit:
  jimr's solution in my other  <a href="https://stackoverflow.com/questions/3048005/document-onclick-settimeout-function-javascript-help">thread</a> worked for my purpose, and so is Robusto's.  </p>
  
  <p>I am just wondering why the "sleep" methods given by Robusto and CMS's link are not preferred. How would that be different than the settimeout method since they both  introduce a pause in the code? (settimeout pauses before the function is executed, the sleep method pauses before the next line is executed.)</p>