| 1 | <?php |
||
| 5 | class Sleeper implements SleeperInterface |
||
| 6 | { |
||
| 7 | /** |
||
| 8 | * The default length of the sleep |
||
| 9 | * |
||
| 10 | * @var int|float $speed |
||
| 11 | */ |
||
| 12 | protected $speed = 50000; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * Set the speed based on a percentage (50% slower, 200% faster, etc) |
||
| 16 | * |
||
| 17 | * @param int|float $percentage |
||
| 18 | * |
||
| 19 | * @return float |
||
| 20 | */ |
||
| 21 | 12 | public function speed($percentage) |
|
| 29 | |||
| 30 | /** |
||
| 31 | * Sleep for the specified amount of time |
||
| 32 | */ |
||
| 33 | 12 | public function sleep() |
|
| 37 | } |
||
| 38 |