PhpBench\Benchmark\RunnerContext::getSleep PHP Method

getSleep() public method

Override the sleep interval (in microseconds).
public getSleep ( $default = null )
    public function getSleep($default = null)
    {
        if (null === $this->options['sleep']) {
            return $default;
        }
        return $this->options['sleep'];
    }

Usage Example

 /**
  * It should throw an exception if iterations is not numeric.
  */
 public function testGetters()
 {
     $options = array('context_name' => 'my_context', 'filters' => array('filter_one', 'filter_two'), 'iterations' => 5, 'revolutions' => 6, 'parameters' => array('one' => 2), 'sleep' => 100, 'retry_threshold' => 10);
     $context = new RunnerContext('/path/to', $options);
     $this->assertEquals('/path/to', $context->getPath());
     $this->assertEquals($options['context_name'], $context->getContextName());
     $this->assertEquals($options['filters'], $context->getFilters());
     $this->assertEquals($options['iterations'], $context->getIterations());
     $this->assertEquals($options['revolutions'], $context->getRevolutions());
     $this->assertEquals(array(array($options['parameters'])), $context->getParameterSets());
     $this->assertEquals($options['sleep'], $context->getSleep());
     $this->assertEquals(10, $context->getRetryThreshold());
 }
All Usage Examples Of PhpBench\Benchmark\RunnerContext::getSleep