@VisibleForTesting
  long getTimeToSleep(long startTime, int copiedEntries, long maxRate) {
    if (maxRate == 0) {
      return 0;
    }
    final long elapsedMs = clock.millis() - startTime;
    if (elapsedMs != 0 && (copiedEntries * 1000.0) / (double) elapsedMs <= maxRate) {
      return 0;
    }
    final long targetElapsedMs = (copiedEntries * 1000L) / maxRate;
    return targetElapsedMs - elapsedMs;
  }
It runs the actions to be done after a batch has been
sent: throw an interrupted exception if the operation was canceled and
adjust the rate of copying by sleeping if necessary.

@param startTime time at which the entries started to be copied
@param copiedEntries number of entries copied so far
@param maxRate maximum copying rate
geode-wan/src/main/java/org/apache/geode/management/internal/cli/functions/WanCopyRegionFunctionDelegate.java