bandwidthThrottle\tokenBucket\BlockingConsumerTest::testMinimumSleep PHP Method

testMinimumSleep() public method

Tests consume() won't sleep less than one millisecond.
public testMinimumSleep ( )
    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));
    }