earlyReturn && $remainder > 0) { $this->usleep($remainder); } return $result; } /** * Indicate that the timebox can return early. * * @return $this */ public function returnEarly() { $this->earlyReturn = true; return $this; } /** * Indicate that the timebox cannot return early. * * @return $this */ public function dontReturnEarly() { $this->earlyReturn = false; return $this; } /** * Sleep for the specified number of microseconds. * * @param int $microseconds * @return void */ protected function usleep(int $microseconds) { usleep($microseconds); } }