public void sleep(long durationMs) {
        long sleepDurationMs = Math.min(durationMs, remainingMs());
        time.sleep(sleepDurationMs);
        update();
    }
Sleep for the requested duration and update the timer. Return when either the duration has
elapsed or the timer has expired.

@param durationMs The duration in milliseconds to sleep
s3stream/src/main/java/com/automq/stream/utils/Timer.java