Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- sleep(4);
- $count = 100;
- for ($x = 0; $x < $count; $x++) {
- $runtimes[$x] = new \parallel\Runtime;
- }
- foreach ($runtimes as $runtime) {
- $futures[] = $runtime->run(function () use ($count) {
- echo --$count, PHP_EOL;
- usleep(100000);
- })->done();
- }
- $buff = $count;
- for ($x = 0; $x < $buff; $x++) {
- echo --$count, PHP_EOL;
- usleep(100000);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement