From cf14306c2b3f82a81f8d56669a71633b4d4b5fce Mon Sep 17 00:00:00 2001 From: marvin-borner@live.com Date: Mon, 16 Apr 2018 21:09:05 +0200 Subject: Main merge to user management system - files are now at /main/public/ --- .../stream/examples/91-benchmark-throughput.php | 62 ---------------------- 1 file changed, 62 deletions(-) delete mode 100755 assets/php/vendor/react/stream/examples/91-benchmark-throughput.php (limited to 'assets/php/vendor/react/stream/examples/91-benchmark-throughput.php') diff --git a/assets/php/vendor/react/stream/examples/91-benchmark-throughput.php b/assets/php/vendor/react/stream/examples/91-benchmark-throughput.php deleted file mode 100755 index ecf695c..0000000 --- a/assets/php/vendor/react/stream/examples/91-benchmark-throughput.php +++ /dev/null @@ -1,62 +0,0 @@ -write('NOTICE: The "xdebug" extension is loaded, this has a major impact on performance.' . PHP_EOL); -} -$info->write('piping from ' . $if . ' to ' . $of . ' (for max ' . $t . ' second(s)) ...'. PHP_EOL); - -// setup input and output streams and pipe inbetween -$fh = fopen($if, 'r'); -$in = new React\Stream\ReadableResourceStream($fh, $loop); -$out = new React\Stream\WritableResourceStream(fopen($of, 'w'), $loop); -$in->pipe($out); - -// stop input stream in $t seconds -$start = microtime(true); -$timeout = $loop->addTimer($t, function () use ($in, &$bytes) { - $in->close(); -}); - -// print stream position once stream closes -$in->on('close', function () use ($fh, $start, $loop, $timeout, $info) { - $t = microtime(true) - $start; - $loop->cancelTimer($timeout); - - $bytes = ftell($fh); - - $info->write('read ' . $bytes . ' byte(s) in ' . round($t, 3) . ' second(s) => ' . round($bytes / 1024 / 1024 / $t, 1) . ' MiB/s' . PHP_EOL); - $info->write('peak memory usage of ' . round(memory_get_peak_usage(true) / 1024 / 1024, 1) . ' MiB' . PHP_EOL); -}); - -$loop->run(); -- cgit v1.2.3