Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Rounds a float
<?php round(int|float $num, int $precision = 0, int $mode = PHP_ROUND_HALF_UP): float
<?php $data = (isset($argv[1]) ? $argv[1] : 'y') . "\n";




$data = str_repeat($data, round(200000 / strlen($data)));



if (!defined('STDOUT') || stream_set_blocking(STDOUT, false) !== true) {

    fwrite(STDERR, 'ERROR: Unable to set STDOUT non-blocking (not CLI or Windows?)' . PHP_EOL);
<?php });



Loop::addPeriodicTimer($r, function () use (&$runs) {

    $kmem = round(memory_get_usage() / 1024);

    $kmemReal = round(memory_get_usage(true) / 1024);

    echo "Runs:\t\t\t$runs\n";

    echo "Memory (internal):\t$kmem KiB\n";
<?php Loop::addPeriodicTimer($r, function () use (&$runs) {

    $kmem = round(memory_get_usage() / 1024);

    $kmemReal = round(memory_get_usage(true) / 1024);

    echo "Runs:\t\t\t$runs\n";

    echo "Memory (internal):\t$kmem KiB\n";

    echo "Memory (real):\t\t$kmemReal KiB\n";
<?php echo "Loop\t\t\t", get_class(Loop::get()), "\n";

echo "Time\t\t\t", date('r'), "\n";

echo "Time taken\t\t", $timeTaken, " seconds\n";

echo "Runs per second\t\t", round($runs / $timeTaken), "\n";