Created
January 27, 2009 23:43
-
-
Save bmizerany/53668 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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