Subversion Repositories php-qbpwcf

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
3 liveuser 1
<?php declare(strict_types=1);
2
 
3
/*
4
 * This file is part of Evenement.
5
 *
6
 * (c) Igor Wiedler <igor@wiedler.ch>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
 
12
const ITERATIONS = 10000000;
13
 
14
use Evenement\EventEmitter;
15
 
16
require __DIR__.'/../vendor/autoload.php';
17
 
18
$emitter = new EventEmitter();
19
 
20
$emitter->on('event', function ($a, $b, $c) {});
21
 
22
$start = microtime(true);
23
for ($i = 0; $i < ITERATIONS; $i++) {
24
    $emitter->emit('event', [1, 2, 3]);
25
}
26
$time = microtime(true) - $start;
27
 
28
echo 'Emitting ', number_format(ITERATIONS), ' events took: ', number_format($time, 2), 's', PHP_EOL;