code: func FormatByteRate(s uint64, d time.Duration) string {
  	// e is the index of the most representative unit of storage.
  	var e float64
  
  	// f is the floating-point equivalent of "s", so as to avoid more
  	// conversions than necessary.
  	f := float64(s)
  
  	if f != 0 {
  		f = f / math.Max(time.Nanosecond.Seconds(), d.Seconds())
  		e = math.Floor(log(f, 1000))
  		if e <= eps {
  			// The result of math.Floor(log(r, 1000)) can be
  			// "close-enough" to zero that it should be effectively
  			// considered zero.
  			e = 0
  		}
  	}
  
  	unit := uint64(math.Pow(1000, e))
  	suffix := sizes[int(e)]
  
  	return fmt.Sprintf("%s %s/s",
  		FormatBytesUnit(uint64(math.Ceil(f)), unit), suffix)
  }
docs: // FormatByteRate outputs the given rate of transfer "r" as the quotient of "s"
  // (the number of bytes transferred) over "d" (the duration of time that those
  // bytes were transferred in).
  //
  // It displays the output as a quantity of a "per-unit-time" unit (i.e., B/s,
  // MiB/s) in the most representative fashion possible, as above.