| Conditions | 2 |
| Paths | 1 |
| Total Lines | 19 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 31 | public function runFor(int $runTime) |
||
| 32 | { |
||
| 33 | $count = 0; |
||
| 34 | $threshold = $runTime * 1000000; |
||
| 35 | $start = self::currentTimeMicros(); |
||
| 36 | |||
| 37 | do { |
||
| 38 | $count++; |
||
| 39 | $this->benchmarked->generate('foo'); |
||
| 40 | } while (self::currentTimeMicros() - $start < $threshold); |
||
| 41 | |||
| 42 | echo \sprintf( |
||
| 43 | "%s: %s UUIDs in %s seconds (%s op/s)\n", |
||
| 44 | \get_class($this->benchmarked), |
||
| 45 | $count, |
||
| 46 | $runTime, |
||
| 47 | \number_format($count/$runTime, 1) |
||
| 48 | ); |
||
| 49 | } |
||
| 50 | |||
| 56 |