Lavoiesl\PhpBenchmark\AbstractTest::run PHP Method

run() public method

public run ( $n = 1 )
    public function run($n = 1)
    {
        $this->prepare();
        gc_collect_cycles();
        // clear memory before start
        $this->profiler->start();
        for ($i = 0; $i < $n; $i++) {
            // Store the result so it appears in memory profiling
            $result = $this->execute();
            unset($result);
        }
        $this->profiler->stop();
        $results = array('time' => $this->profiler->getTime(), 'memory' => $this->profiler->getMemoryUsage(), 'n' => $n);
        $this->cleanup();
        return $results;
    }