long sleep(long nanos) throws InterruptedException {
    if (nanos <= 0) {
      return nanos;
    }

    final long start = System.nanoTime();
    TimeUnit.NANOSECONDS.sleep(nanos);

    return MathUtil.clampAdd(nanos, -(System.nanoTime() - start));
  }
Sleeps for a period of time that approximates the requested number of nanoseconds. Actual sleep
time can vary significantly based on the JVM implementation and platform. This function returns
the measured error between expected and actual sleep time.

@param nanos the number of nanoseconds to sleep.
@throws InterruptedException if the current thread is interrupted while blocked in this method.
samza-core/src/main/java/org/apache/samza/util/ThrottlingExecutor.java