Skip to content

Commit 8566445

Browse files
committed
refactor to use list()
1 parent 21489a7 commit 8566445

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

benchmark/run.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,7 @@
6161
$testDef = @include $file;
6262

6363
if (is_array($testDef)) {
64-
$sourceFactory = $testDef[0];
65-
$loop = $testDef[1];
64+
list($sourceFactory, $loop) = $testDef;
6665
} elseif (is_callable($testDef)) {
6766
$sourceFactory = $testDef;
6867
} else {
@@ -91,6 +90,7 @@ function () use (&$start, &$durations) {
9190
$stopStartTime = microtime(true) + MIN_TOTAL_DURATION;
9291

9392
if ($loop) {
93+
// Run all tests inside the loop to avoid starting it over and over again
9494
$reschedule = function() use (&$reschedule, $benchmarkLoop, $sourceFactory, $loop, $stopStartTime) {
9595
$loop->futureTick(function () use (&$reschedule, $benchmarkLoop, $stopStartTime, $sourceFactory) {
9696
$benchmarkLoop($sourceFactory());

0 commit comments

Comments
 (0)