PHP Class Tolerance\Throttling\Rate\TimeRate

See also: https://github.com/bandwidth-throttle/token-bucket/blob/master/classes/Rate.php
Inheritance: implements Tolerance\Throttling\Rate\Rate
Mostrar archivo Open project: sroze/tolerance

Public Methods

Method Description
__construct ( integer $ticks, string $unit ) Sets the amount of ticks which will be produced per unit.
getTicks ( ) : float It returns the number of ticks per second basically.

Method Details

__construct() public method

E.g. new TimeRate(100, TimeRate::PER_SECOND) will produce 100 ticks per second.
public __construct ( integer $ticks, string $unit )
$ticks integer The amount of ticks per unit
$unit string The unit as one of Rate's constants

getTicks() public method

It returns the number of ticks per second basically.
public getTicks ( ) : float
return float