static void sleepForAtLeast(Duration duration) {
    long sleepTimeNanos = duration.toNanos();
    long startTimeNanos = nanoTime();

    while (true) {
      long elapsedTimeNanos = nanoTime() - startTimeNanos;
      if (elapsedTimeNanos >= sleepTimeNanos) {
        break;
      }

      long remainingTimeNanos = sleepTimeNanos - elapsedTimeNanos;
      try {
        Thread.sleep(max(MIN_TIME_TO_SLEEP.toMillis(), NANOSECONDS.toMillis(remainingTimeNanos)));
      } catch (InterruptedException ignored) {
      }
    }
  }
Replacement for {@link Thread#sleep(long)} that sleeps at least as long as the given duration

@param duration duration to sleep
geode-assembly/src/acceptanceTest/java/org/apache/geode/metrics/function/executions/ThreadSleep.java