title: Why would I use `case <-time.After(time.Second * 1):` over `time.Sleep(time.Second * 1)` in golang
body: <p>Looking through some code I found two ways of doing something every second:</p>
  
  <pre><code>for {
      fmt.Println("This is printed every second")
      time.Sleep(time.Second * 1)
  }
  </code></pre>
  
  <p>and</p>
  
  <pre><code>for {
      select {
      case &lt;-time.After(time.Second * 1):
          fmt.Println("This is printed every second")
      }
  }
  </code></pre>
  
  <p>Apart from the first one being more readable (in my opinion), I don't really understand what the advantages of one over the other is. Does anybody know?</p>