PHP Класс bandwidthThrottle\tokenBucket\Rate

Автор: Markus Malkusch ([email protected])
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( integer $tokens, string $unit ) Sets the amount of tokens which will be produced per unit.
getTokensPerSecond ( ) : double Returns the rate in Tokens per second.

Описание методов

__construct() публичный Метод

E.g. new Rate(100, Rate::SECOND) will produce 100 tokens per second.
public __construct ( integer $tokens, string $unit )
$tokens integer positive amount of tokens to produce per unit
$unit string unit as one of Rate's constants

getTokensPerSecond() публичный Метод

Returns the rate in Tokens per second.
public getTokensPerSecond ( ) : double
Результат double The rate.