code: func (conn *Conn) rateLimit(chars int) time.Duration {
  	// Hybrid's algorithm allows for 2 seconds per line and an additional
  	// 1/120 of a second per character on that line.
  	linetime := 2*time.Second + time.Duration(chars)*time.Second/120
  	elapsed := time.Now().Sub(conn.lastsent)
  	if conn.badness += linetime - elapsed; conn.badness < 0 {
  		// negative badness times are badness...
  		conn.badness = 0
  	}
  	conn.lastsent = time.Now()
  	// If we've sent more than 10 second's worth of lines according to the
  	// calculation above, then we're at risk of "Excess Flood".
  	if conn.badness > 10*time.Second {
  		return linetime
  	}
  	return 0
  }
docs: // rateLimit implements Hybrid's flood control algorithm for outgoing lines.