| 1 | <?php |
||
| 13 | class Benchmarker |
||
| 14 | { |
||
| 15 | /** |
||
| 16 | * @var UuidGenerator |
||
| 17 | */ |
||
| 18 | private $benchmarked; |
||
| 19 | |||
| 20 | public function __construct(UuidGenerator $generator) |
||
| 24 | |||
| 25 | /** |
||
| 26 | * Calls $this->benchmarked->generate() continuously |
||
| 27 | * for the supplied amount of seconds. |
||
| 28 | * |
||
| 29 | * Then reports total number of calls and avg throughput. |
||
| 30 | */ |
||
| 31 | public function runFor(int $runTime) |
||
| 50 | |||
| 51 | private static function currentTimeMicros(): int |
||
| 55 | } |
||
| 56 |