private function printResults($test, $time, $iterations) {
if (0 == $iterations) {
throw new \InvalidArgumentException('$iterations cannot be zero.');
}
$title = $test . " results:\n";
$iterationsText = sprintf("Iterations: %d\n", $iterations);
$totalTime = sprintf("Total Time: %.3f s\n", $time);
$iterationTime = sprintf("Time per iteration: %.3f ms\n", $time / $iterations * 1000);
$max = max(strlen($title), strlen($iterationTime)) - 1;
echo "\n" . str_repeat('-', $max) . "\n";
echo $title;
echo str_repeat('=', $max) . "\n";
echo $iterationsText;
echo $totalTime;
echo $iterationTime;
echo str_repeat('-', $max) . "\n";
}