deadline = microtime( true ) + max( 0.0, $seconds ); } /** * Whether there's time for another item. * * @since 1.0.0 * @return bool */ public function has_time(): bool { return 0 === $this->worked || microtime( true ) < $this->deadline; } /** * Count one item done. * * @since 1.0.0 * @return void */ public function spend(): void { ++$this->worked; } }