code: double getFraction(Timestamp now) {
      Duration elapsedTime = now.subtractTimestamp(start);
      checkArgument(
          elapsedTime.compareTo(ZERO) >= 0 && elapsedTime.compareTo(duration) < 0,
          "This bucket must be current.");
      return ((double) elapsedTime.toMillis()) / duration.toMillis();
    }
docs: /*
  Returns how much fraction of duration has passed in this IntervalBucket. For example, if this
  bucket starts at 10s and has a duration of 20s, and now is 15s, then getFraction() should
  return (15 - 10) / 20 = 0.25.
  
  This IntervalBucket must be current, i.e. the current timestamp must be within
  [this.start, this.start + this.duration).