title: Using x/time/rate.Limiter to determine N events happen within seconds
body: <p>I'm not understanding how Go's <a href="https://godoc.org/golang.org/x/time/rate" rel="nofollow noreferrer">rate limiter package</a> works. I want to use it to determine if some timestamps happen within a certain amount of time.</p>
  
  <pre><code>    var wg sync.WaitGroup
      wg.Add(2)
      limiter := rate.NewLimiter(rate.Every(100 * time.Second), 2)
      go func(limiter *rate.Limiter) {
          fmt.Println("Waiting!!")
              for {
                  if !limiter.Allow() {
                      fmt.Println("Not allowed!!!")
                  } else {
                      fmt.Println("allowed!!")
                  }
              }
  
          fmt.Println("done? blocked?")
      }(limiter)
  
      wg.Wait()
  </code></pre>
  
  <p>Why is "Not allowed!!!" being printed even though I haven't added anything to the rate limiter to determine if 2 events happen in certain amount of seconds? </p>