#!/usr/bin/env ruby
# Copyright (C) 2003-2005 Kouichirou Eto, All rights reserved.

$LOAD_PATH.unshift("../../compat") unless $LOAD_PATH.include?("../../compat")
$LOAD_PATH << "../../lib" unless $LOAD_PATH.include?("../../lib")
require "qwik/server"
require "qwik/test-module-session"
require "qwik/test-module-bench"

class BenchTextFormat
  include TestSession
  include BenchmarkTest

  def bench_all
#    n = 1
    n = 10
#    n = 100
#    n = 1000
    t_add_user
    benchmark {
      n.times {
	session("/test/TextFormat.html")
	dummy_str = @res.setback_body(@res.body)
#	puts dummy_str
	puts dummy_str.length
      }
    }
  end
end

b = BenchTextFormat.new
b.setup
b.bench_all
b.teardown
