write('NOTICE: The "xdebug" extension is loaded, this has a major impact on performance.' . PHP_EOL); } try { if (!@\assert(false)) { $stderr->write("NOTICE: Assertions are enabled, this has a major impact on performance." . PHP_EOL); } } catch (AssertionError $exception) { $stderr->write("NOTICE: Assertions are enabled, this has a major impact on performance." . PHP_EOL); } $stderr->write('piping from ' . $if . ' to ' . $of . ' (for max ' . $t . ' second(s)) ...'. PHP_EOL); Loop::delay($t * 1000, [$in, "close"]); Loop::run(function () use ($stderr, $in, $out) { $start = microtime(true); while (($chunk = yield $in->read()) !== null) { yield $out->write($chunk); } $t = microtime(true) - $start; $bytes = ftell($out->getResource()); $stderr->write('read ' . $bytes . ' byte(s) in ' . round($t, 3) . ' second(s) => ' . round($bytes / 1024 / 1024 / $t, 1) . ' MiB/s' . PHP_EOL); $stderr->write('peak memory usage of ' . round(memory_get_peak_usage(true) / 1024 / 1024, 1) . ' MiB' . PHP_EOL); });