Performs a check between the timeout definition and the time the process started.
In case you run a background process (with the start method), you should trigger this method regularly to ensure the process timeout
RuntimeException In case the timeout was reached
public function checkTimeout() {
if (0 < $this->timeout && $this->timeout < microtime(true) - $this->starttime) {
$this
->stop(0);
throw new RuntimeException('The process timed-out.');
}
}