title: How do I execute a command one after another, each at a separate time?
body: <p>In Windows Terminal, I am able to execute several commands at the same i.e.:</p>
  
  <pre><code>echo %time% &amp;&amp; timeout 3 &amp;&amp; echo %time%
  </code></pre>
  
  <p>However, when executing the above command, It will result in something like:</p>
  
  <pre><code>9:27:57.41
  0 秒待っています。続行するには何かキーを押してください ... (My operating system 
  is Japanese)
  9:27:57.41
  </code></pre>
  
  <p>As you can see, <code>echo %time%</code> is not executed at a different time even though there was a 3 second timeout in between.
  How would I separate these two executions?</p>
  
  <p>The End goal here is to measure the the time it takes to perform <code>dir /s C:\</code>.</p>
  
  <p>I tried different things such as:</p>
  
  <pre><code>Powershell -C "Measure-Command {cmd /c dir /s C:\ | Output-Default}" &gt; test.txt
  </code></pre>
  
  <p>or from Powershell:</p>
  
  <pre><code>Measure-Command{cmd /c dir /s C:\ | Output-Default} &gt; test.txt
  </code></pre>
  
  <p>But neither of these commands result in the same result I get from running just <code>dir /s C:\</code> in Terminal. There are differences in time and file count.</p>
  
  <p>I thought I could try:</p>
  
  <pre><code>echo %time% &gt;&gt; test &amp; dir /s C:\ &gt;&gt; test &amp; echo %time% &gt;&gt; test
  </code></pre>
  
  <p>as an alternative to the <code>Measure-Command</code> but that is not the case...</p>
  
  <p>Something similar can easily be done in linux i.e <code>date +%N &amp;&amp; sleep 1 &amp;&amp; date +%N</code> or <code>date +%s &amp;&amp; sleep 1 &amp;&amp; date +%s</code> so why not the almighty Powershell? (a bit of sarcasm)</p>
  
  <p>Any other alternatives I could try or shedding some light to how this all works would help a ton.</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>With the help from Drew, I was able to do this with the <code>Get-ChildItem</code> method in Powershell. However, this only took a fraction of the time it would take with <code>dir /s</code>. The key goal here is to measure how long it takes with <code>dir</code> so this is mandatory. </p>
  
  <p><strong>EDIT2:</strong></p>
  
  <p>Seems like writing the standard output to the terminal was taking time and not the command itself. Redirecting the output to a File or <code>&gt; NUL</code> was much faster.</p>
  
  <p>Kind regards.</p>