Skip to content

Commit

Permalink
storing information of every loop in benchmark object
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Gaal committed May 4, 2017
1 parent 2dcb95e commit 521c093
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Benchmark.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ class Benchmark
*/
protected $memory = [];

/**
* @var array
*/
protected $loops = [];

/**
* @return Benchmark
*/
Expand Down Expand Up @@ -70,6 +75,11 @@ public static function time($callback, $loops = 1, $avg = false)
$memory['peak'] += $memoryLoop['peak'];

$time = $time + (microtime(true) - $timeLoop);

$benchmark->loops[] = [
'memory' => $memory,
'time' => $time
];
}

if ($avg) {
Expand Down

0 comments on commit 521c093

Please sign in to comment.