PhpBench\Benchmark\RunnerContext::getIterations PHP Method

getIterations() public method

Override the number of iterations to execute.
public getIterations ( $default = null ) : integer
return integer
    public function getIterations($default = null)
    {
        return $this->options['iterations'] ?: $default;
    }

Usage Example

Exemplo n.º 1
0
 /**
  * Defaults should be ignored if explicit values are set in the context.
  */
 public function testOverride()
 {
     $context = new RunnerContext(__DIR__, array('iterations' => 20, 'revolutions' => 30, 'retry_threshold' => 40));
     $this->assertEquals(20, $context->getIterations(10));
     $this->assertEquals(30, $context->getRevolutions(10));
     $this->assertEquals(40, $context->getRetryThreshold(10));
 }
All Usage Examples Of PhpBench\Benchmark\RunnerContext::getIterations