public function benchmark($iterations = 10000, $inputSize = null)
    {
        $set = new BenchmarkResultsSet($iterations, $inputSize);
        $this->resultsGroup->addSet($set);

        foreach ($this->getSamplersForInputSize($inputSize) as $name => $func) {
            $actualIterations = $this->getActualIterations($name, $iterations, $inputSize);

            $start = microtime(true);
            for ($i = 0; $i < $actualIterations; $i++)
                $func();
            $time = microtime(true) - $start;

            $set->addBenchmark(new Benchmark($name, $time, $actualIterations));
        }

        return $this;
    }
public function benchmark($iterations = 10000, $inputSize = null)
    {
        $set = new BenchmarkResultsSet($iterations, $inputSize);
        $this->resultsGroup->addSet($set);

        foreach ($this->getSamplersForInputSize($inputSize) as $name => $func) {
            $actualIterations = $this->getActualIterations($name, $iterations, $inputSize);

            $start = microtime(true);
            for ($i = 0; $i < $actualIterations; $i++)
                $func();
            $time = microtime(true) - $start;

            $set->addBenchmark(new Benchmark($name, $time, $actualIterations));
        }

        return $this;
    }
public function benchmark ( $ iterations = 10000 , $ inputSize = null ) { $ set = new BenchmarkResultsSet ( $ iterations , $ inputSize ) ; $ this -> resultsGroup -> addSet ( $ set ) ; foreach ( $ this -> getSamplersForInputSize ( $ inputSize ) as $ name => $ func ) { $ actualIterations = $ this -> getActualIterations ( $ name , $ iterations , $ inputSize ) ; $ start = microtime ( true ) ; for ( $ i = 0 ; $ i < $ actualIterations ; $ i ++ ) $ func ( ) ; $ time = microtime ( true ) - $ start ; $ set -> addBenchmark ( new Benchmark ( $ name , $ time , $ actualIterations ) ) ; } return $ this ; }
Perform a set of benchmarks.

@param int $iterations       The number of iterations. Cam be corrected by $iterationCorrections
@param int|null $inputSize   The size of the input. Null for unspecified size.

@return $this
Perform a set of benchmarks .