Skip to content

Instantly share code, notes, and snippets.

@bmizerany
Created January 27, 2009 23:43
Show Gist options
  • Select an option

  • Save bmizerany/53668 to your computer and use it in GitHub Desktop.

Select an option

Save bmizerany/53668 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'sinatra'
require 'benchmark'
class SimpleBenchmark
def initialize(app)
@app = app
end
def call(env)
response = nil
Benchmark.bmbm { |x| x.report { response = @app.call(env) } }
response
end
end
use SimpleBenchmark
get '/' do
sleep(3)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment