diff --git a/src/Commands/AdvancedQueueCommands.php b/src/Commands/AdvancedQueueCommands.php
index 474a562..aad45aa 100644
--- a/src/Commands/AdvancedQueueCommands.php
+++ b/src/Commands/AdvancedQueueCommands.php
@@ -48,12 +48,17 @@ class AdvancedQueueCommands extends DrushCommands {
    *
    * @param string $queue_id
    *   The queue ID.
+   * @param array $options
+   *   The options passed to this drush function.
    *
    * @throws \Exception
    *
    * @command advancedqueue:queue:process
+   * @option timeout The maximum execution time of the script. Be warned that this is a rough estimate as the time is only checked between two items.
+   * @usage advancedqueue:queue:process queuename --timeout=60
+   *   Create a daemon-esque process for 60 seconds to process the {queuename} queue. After this, the process will complete.
    */
-  public function process($queue_id) {
+  public function process($queue_id, $options = ['timeout' => 90]) {
     $queue_storage = $this->entityTypeManager->getStorage('advancedqueue_queue');
     /** @var \Drupal\advancedqueue\Entity\QueueInterface $queue */
     $queue = $queue_storage->load($queue_id);
@@ -61,6 +66,11 @@ class AdvancedQueueCommands extends DrushCommands {
       throw new \Exception(dt('Could not find queue "@queue_id".', ['@queue_id' => $queue_id]));
     }
 
+    // Set the processing time for this Drush command. Note: it is up to
+    // Processor implementations to handle this. See the default
+    // \Drupal\advancedqueue\Processor class for an example of this.
+    $queue->setProcessingTime((int) $options['timeout']);
+
     $start = microtime(TRUE);
     $num_processed = $this->processor->processQueue($queue);
     $elapsed = microtime(TRUE) - $start;
diff --git a/src/Processor.php b/src/Processor.php
index c01f916..82927ad 100644
--- a/src/Processor.php
+++ b/src/Processor.php
@@ -67,18 +67,19 @@ class Processor implements ProcessorInterface {
     $num_processed = 0;
 
     while (TRUE) {
+      if ($processing_time && $this->time->getCurrentTime() >= $expected_end) {
+        // Time limit reached. Stop here.
+        break;
+      }
+
       $job = $queue->getBackend()->claimJob();
       if (!$job) {
-        // The queue is empty. Stop here.
-        break;
+        // No item processed in that round, let the CPU rest.
+        sleep(1);
+        continue;
       }
       $this->processJob($job, $queue);
       $num_processed++;
-
-      if ($processing_time && $this->time->getCurrentTime() >= $expected_end) {
-        // Time limit reached. Stop here.
-        break;
-      }
     }
 
     return $num_processed;
