You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: revoked_checks.rb
    path of file: ./repos/karafka/spec/benchmarks/offset_management
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

setup_karafka { |config| config.concurrency = 1 }

MAX_MESSAGES = 100_000

$times = []

class Consumer < Karafk
    
  def consume
    @count ||= 0
    @count += messages.size

    messages.each do
      start = Time.now
      revoked?
      stop = Time.now

      $times << stop - start
    end

    return if @count < MAX_MESSAGES
    return if $stop

    Thread.new { Karafka::Server.stop }
  end