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

If the underlying token bucket doesn't have sufficient tokens, the consumer blocks until it can consume the tokens.
public consume ( integer $tokens )
$tokens integer The token amount.
 /**
  * Tests consume() won't sleep less than one millisecond.
  *
  * @test
  */
 public function testMinimumSleep()
 {
     $rate = new Rate(10, Rate::MILLISECOND);
     $bucket = new TokenBucket(1, $rate, new SingleProcessStorage());
     $bucket->bootstrap();
     $consumer = new BlockingConsumer($bucket);
     $time = microtime(true);
     $consumer->consume(1);
     $this->assertLessThan(1.0E-5, abs(microtime(true) - $time - 0.001));
 }