# File lib/railsbench/benchmark.rb, line 253
  def bmbm(width = 0, &blk) # :yield: job
    job = Job.new(width)
    yield(job)
    width = job.width
    if SYNC
      sync = OUTPUT.sync
      OUTPUT.sync = true
    end

    # rehearsal
    OUTPUT.print "Rehearsal "
    puts '-'*(width+CAPTION.length - "Rehearsal ".length)
    list = []
    job.list.each{|label,item|
      OUTPUT.print(label.ljust(width))
      res = Benchmark::measure(&item)
      OUTPUT.print res.format()
      list.push res
    }
    sum = Tms.new; list.each{|i| sum += i}
    ets = sum.format("total: %tsec")
    OUTPUT.printf("%s %s\n\n",
                  "-"*(width+CAPTION.length-ets.length-1), ets)
    
    # take
    OUTPUT.print ' '*width, CAPTION
    list = []
    ary = []
    job.list.each{|label,item|
      GC::start
      OUTPUT.print label.ljust(width)
      res = Benchmark::measure(&item)
      OUTPUT.print res.format()
      ary.push res
      list.push [label, res]
    }

    OUTPUT.sync = sync if SYNC
    ary
  end