Code example for TimeUnit

Methods: convert

0
     * @param timeUnit the time unit to return the value in. 
     * @return the maximum execution time 
     * @since 2.12.0 
     */ 
    public long getMaxTime(final TimeUnit timeUnit) {
        return timeUnit.convert(_maxTimeMS, MILLISECONDS);
    } 
 
    /** 
     * Sets the max execution time for this command, in the given time unit. 
     * 
     * @param maxTime  the maximum execution time. A non-zero value requires a server version >= 2.6 
     * @param timeUnit the time unit that maxTime is specified in 
     * @since 2.12.0 
     */ 
    public void setMaxTime(final long maxTime, final TimeUnit timeUnit) {
        this._maxTimeMS = MILLISECONDS.convert(maxTime, timeUnit);
    } 
 
    /** 
     * Gets the (optional) JavaScript  scope