@Override
  public void accept(Long value) {
    valueSoFar = valueSoFar == null ? value : valueSoFar + value;

    Instant now = getNow.get();
    Instant nextFireTime = previousCallback.plus(delayBetweenCallbacks);
    if (now.isAfter(nextFireTime)) {
      consumer.accept(valueSoFar);
      previousCallback = now;
      valueSoFar = null;
    }
  }
A new configured consumer.

@param consumer {@link Consumer} callback to wrap
@param delayBetweenCallbacks delay between each call to the underlying accept
@param getNow supplies of the current time {@link Instant}
jib-core/src/main/java/com/google/cloud/tools/jib/event/progress/ThrottledAccumulatingConsumer.java