code: public long getResetMillis(RateBucketPeriod period) {
          long now = System.currentTimeMillis();
          long periodBoundary = getPeriodBoundary(now, period);
          return periodBoundary - now;
      }
docs: Returns the number of millis until the period resets.
  @param period the period
  @return millis until period resets