title: What is the purpose of setTimeout in Angular?
body: <p>Below is a snippet of code from the Tour of Heros tutorial for Angular.io:</p>
  
  <pre><code>getHeroesSlowly(): Promise&lt;Hero[]&gt; {
    return new Promise(resolve =&gt; {
       // Simulate server latency with 2 second delay
      setTimeout(() =&gt; resolve(this.getHeroes()), 2000);
    });
  }
  </code></pre>
  
  <p>The description states: <i>To simulate a slow connection, import the Hero symbol and add the following getHeroesSlowly() method to the HeroService.</i></p>
  
  <p>I understand that it is best practice to build websites based on slow connections with two examples of such being <a href="https://stackoverflow.com/questions/3536249/simulating-slow-internet-connection">here</a> and <a href="https://helpdeskgeek.com/networking/simulate-slow-internet-connection-testing/" rel="noreferrer">here</a>. </p>
  
  <p>But why would I set a timer to test the build (like the one that Angular suggests) instead of throttling the connection (say in Chrome)? </p>