src/BotManager.php
public function handleGetUpdatesLoop(int $loop_time_in_seconds, int $loop_interval_in_seconds = 2): self
    {
        // Remember the time we started this loop.
        $now = time();

        $this->handleOutput('Looping getUpdates until ' . date('Y-m-d H:i:s', $now + $loop_time_in_seconds) . PHP_EOL);

        while ($now > time() - $loop_time_in_seconds) {
            $this->handleGetUpdates();

            // Chill a bit.
            sleep($loop_interval_in_seconds);
        }

        return $this;
    }
public function handleGetUpdatesLoop(int $loop_time_in_seconds, int $loop_interval_in_seconds = 2): self
    {
        // Remember the time we started this loop.
        $now = time();

        $this->handleOutput('Looping getUpdates until ' . date('Y-m-d H:i:s', $now + $loop_time_in_seconds) . PHP_EOL);

        while ($now > time() - $loop_time_in_seconds) {
            $this->handleGetUpdates();

            // Chill a bit.
            sleep($loop_interval_in_seconds);
        }

        return $this;
    }
public function handleGetUpdatesLoop ( int $ loop_time_in_seconds , int $ loop_interval_in_seconds = 2 ) : self { // Remember the time we started this loop. $ now = time ( ) ; $ this -> handleOutput ( 'Looping getUpdates until ' . date ( 'Y-m-d H:i:s' , $ now + $ loop_time_in_seconds ) . PHP_EOL ) ; while ( $ now > time ( ) - $ loop_time_in_seconds ) { $ this -> handleGetUpdates ( ) ; // Chill a bit. sleep ( $ loop_interval_in_seconds ) ; } return $ this ; }
Loop the getUpdates method for the passed amount of seconds.

@param int $loop_time_in_seconds
@param int $loop_interval_in_seconds

@return \TelegramBot\TelegramBotManager\BotManager
@throws \Longman\TelegramBot\Exception\TelegramException
Loop the getUpdates method for the passed amount of seconds .