Conditions | 1 |
Paths | 1 |
Total Lines | 6 |
Code Lines | 4 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
20 | public static function assertExecutionMemoryLessThenOrEqual(float $memoryInKb, callable $workload): void |
||
21 | { |
||
22 | $beforeMemory = memory_get_usage(); |
||
23 | $workload(); |
||
24 | $memoryUsage = memory_get_usage() - $beforeMemory; |
||
25 | self::assertLessThanOrEqual(1024 * $memoryInKb, $memoryUsage, 'Execution memory of this workload should be less then ' . $memoryInKb . 'KB.'); |
||
26 | } |
||
28 |