public function getTokensPerSecond() { return $this->tokens / self::$unitMap[$this->unit]; }
/** * Converts an amount of tokens into a duration of seconds. * * @param int $tokens The amount of tokens. * @return double The seconds. */ public function convert($tokens) { return $tokens / $this->rate->getTokensPerSecond(); }