Skip to content

Commit

Permalink
Fix benchmark example
Browse files Browse the repository at this point in the history
  • Loading branch information
kelunik committed Feb 1, 2018
1 parent 5238fee commit 84ba8e2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions examples/8-benchmark.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

require __DIR__ . '/../vendor/autoload.php';

$count = (int) ($argv[1] ?? "100");
$count = (int) ($argv[1] ?? "1000");

Loop::run(function () use ($count) {
$client = new Amp\Artax\DefaultClient;
Expand All @@ -26,7 +26,7 @@
}
});

while ($count === 0) {
do {
$promises = [];
for ($i = 0; $i < 10; $i++) {
$promises[] = $handler($count === 0 ? 100 : $count);
Expand All @@ -37,5 +37,5 @@
gc_mem_caches();

print "Memory: " . (memory_get_usage(true) / 1000) . PHP_EOL;
}
} while ($count === 0);
});

0 comments on commit 84ba8e2

Please sign in to comment.