driver-core/src/main/com/mongodb/operation/AggregateOperation.java
public AggregateOperation<T> maxTime(final long maxTime, final TimeUnit timeUnit) {
        wrapped.maxTime(maxTime, timeUnit);
        return this;
    }
public AggregateOperation<T> maxTime(final long maxTime, final TimeUnit timeUnit) {
        wrapped.maxTime(maxTime, timeUnit);
        return this;
    }
Sets the maximum execution time on the server for this operation.

@param maxTime  the max time
@param timeUnit the time unit, which may not be null
@return this
@mongodb.driver.manual reference/method/cursor.maxTimeMS/#cursor.maxTimeMS Max Time