/*
Throttle

@param int   $minimum in milliseconds
@param int   $maximum in milliseconds
510979
public function throttle($minimum = 1000, $maximum = 2500)
    {
        // In microseconds
        $throttleTime = rand($minimum * 1000, $maximum * 1000);
        usleep($throttleTime);

        // In seconds
        $this->addContext('bouncer', array(
            'throttle_time' => ($throttleTime / 1000 / 1000)
        ));
    }
934801
protected function addWhereBetween(string $key, int $min, int $max): void
    {
        $phMin = $this->addBindingValue($key, $min);
        $phMax = $this->addBindingValue($key, $max);
        $key = $this->quoteName($key);
        $this->statement .= sprintf('%s BETWEEN %s AND %s', $key, $phMin, $phMax);
        $this->statement .= PHP_EOL;
    }
631402
function throttle(func, delay) {
      var recent;
      return function throttled() {
        var context = this;
        var args = arguments;
        var now = $mdUtil.now();

        if (!recent || (now - recent > delay)) {
          func.apply(context, args);
          recent = now;
        }
      };
    }
1334510
public function rule_between_num( $key, $value, $min, $max )
	{
		if ( !$this->rule_min_num( $key, $value, $min ) )
		{
			return false;
		}
		if ( !$this->rule_max_num( $key, $value, $max ) )
		{
			return false;
		}
		return true;
	}
73889
public static function getRandom($min,$max){
		if($min === null)
			$min = 0;
		if($max === null)
			$max = 1;
		return mt_rand($min, $max);
	}
25923
function setMinute( $min )
    {
        $this->Time = $this->hour() * self::SECONDS_AN_HOUR + ($min % 60) * self::SECONDS_A_MINUTE + $this->second();
        $this->IsValid = $this->Time >= 0;
    }
1018501
public function sleep($statuses = array(), $minimum = 1000, $maximum = 2500)
    {
        $identity = $this->getIdentity();

        if (in_array($identity->getStatus(), $statuses)) {
            return $this->throttle($minimum, $maximum);
        }
    }
36067
public function min($min, bool $isInclusive = true) : self
    {
        $this->createRule(MinRule::class, [$min, $isInclusive]);

        return $this;
    }
397939
public function setMin($min)
  {
    if (!is_numeric($min))
    {
      $min = null;
    }
    $this->min = $min;

    return $this;
  }
579695
public function min($min, $message = null)
    {
        $this->set([
            'min' => (int)$min,
        ], $message);
        return $this;
    }
904712
public function setLevel($min = null, $max = null)
    {
        // Null for default allows easier calling to set
        // a maximum level only
        if (!$min || !Logger::isLogLevel($min)) {
            $min = LogLevel::DEBUG;
        }

        if (!$max || !Logger::isLogLevel($max)) {
            $max = LogLevel::EMERGENCY;
        }

        $this->minimumLevel = Logger::$levels[$min];
        $this->maximumLevel = Logger::$levels[$max];
    }
1335459
public function setMax($max)
  {
    if (!is_numeric($max))
    {
      $max = null;
    }
    $this->max = $max;

    return $this;
  }
96291
function SetIDRange ( $min, $max )
    {
        assert ( is_numeric($min) );
        assert ( is_numeric($max) );
        assert ( $min<=$max );
        $this->_min_id = $min;
        $this->_max_id = $max;
    }
219439
function SetMaxQueryTime ( $max )
    {
        assert ( is_int($max) );
        assert ( $max>=0 );
        $this->_maxquerytime = $max;
    }
823091
public function setMin(int $min): void{
        if($this->max < $min){
            throw new \InvalidArgumentException();
        }

        $this->min  = $min;
    }
564487
public static void checkMinMax(int min, int max) {
    checkMin(min);
    checkMax(max);
    checkArgument(min <= max, "min > max");
  }
533197
public function clip(float $min, float $max) : self
    {
        if ($min > $max) {
            throw new InvalidArgumentException('Minimum cannot be'
                . ' greater than maximum.');
        }

        $b = [];

        foreach ($this->a as $row) {
            $temp = [];

            foreach ($row as $value) {
                if ($value > $max) {
                    $temp[] = $max;

                    continue 1;
                }

                if ($value < $min) {
                    $temp[] = $min;

                    continue 1;
                }

                $temp[] = $value;
            }

            $b[] = $temp;
        }

        return self::quick($b);
    }