code: func (l *TimeLimiter) wait(now time.Time) time.Duration {
  
  	// if we passed the window, reset and start over
  	// if clock is adjusted backwards, best we can do is also just reset and start over
  	if now.After(l.next) || now.Before(l.since) {
  		l.timeSpent = 0
  		l.since = now
  		l.next = now.Add(l.window)
  		return 0
  	}
  	if l.timeSpent < l.limit {
  		return 0
  	}
  
  	// here we know that:
  	// since <= now <= next
  	// timespent >= limit
  	timeToPass := time.Duration(float64(l.timeSpent) * l.factor)
  	timePassed := now.Sub(l.since)
  
  	// not sure if this should happen, but let's be safe anyway
  	if timePassed > timeToPass {
  		return 0
  	}
  	return timeToPass - timePassed
  }
docs: // wait returns how long should be slept at a given time. See Wait() for more info