    # File lib/rubygame/queue.rb, line 159
        def wait(delay=10, &block)
          iterations = 0
          if block_given?
            loop do
              fetch_sdl_events() if @autofetch
              if self.length >= 1
                s = self.shift
                return s unless s == nil
              end
              yield iterations
              iterations += 1
              Rubygame::Clock.delay(delay)
            end
          else
            loop do
              fetch_sdl_events() if @autofetch
              s = self.shift
              return s unless s == nil
              iterations += 1
              Rubygame::Clock.delay(delay)
            end
          end
        end