Conditions | 1 |
Paths | 1 |
Total Lines | 7 |
Code Lines | 4 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
11 | public static function assertExecutionTimeLessThenOrEqual(float $timeInSeconds, callable $workload): void |
||
12 | { |
||
13 | $beforeTime = microtime(true); |
||
14 | $workload(); |
||
15 | $timeUsage = microtime(true) - $beforeTime; |
||
16 | |||
17 | self::assertLessThanOrEqual($timeInSeconds, $timeUsage, 'Execution time of this workload should be less then ' . $timeInSeconds . ' seconds.'); |
||
18 | } |
||
28 |