| Conditions | 3 |
| Paths | 3 |
| Total Lines | 14 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 72 | public function sleep() |
||
| 73 | { |
||
| 74 | $start = microtime(true); |
||
| 75 | $until = $this->getTimeSleepUntil(); |
||
| 76 | if (microtime(true) > $until) { |
||
| 77 | return 0; |
||
| 78 | } |
||
| 79 | try { |
||
| 80 | time_sleep_until($until); |
||
| 81 | } catch (\Exception $warning) { |
||
| 82 | // Timestamp already in the past |
||
| 83 | } |
||
| 84 | return microtime(true) - $start; |
||
| 85 | } |
||
| 86 | } |
||
| 87 |