PHP Class bandwidthThrottle\tokenBucket\Rate

Author: Markus Malkusch ([email protected])
Afficher le fichier Open project: bandwidth-throttle/token-bucket Class Usage Examples

Méthodes publiques

Méthode Description
__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.

Method Details

__construct() public méthode

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() public méthode

Returns the rate in Tokens per second.
public getTokensPerSecond ( ) : double
Résultat double The rate.