Sets an “X-Runtime” response header, indicating the response time of the request, in seconds
You can put it right before the application to see the processing time, or before all the other middlewares to include time for them, too.
# File lib/rack/runtime.rb, line 15 15: def call(env) 16: start_time = Time.now 17: status, headers, body = @app.call(env) 18: request_time = Time.now - start_time 19: 20: if !headers.has_key?(@header_name) 21: headers[@header_name] = "%0.6f" % request_time 22: end 23: 24: [status, headers, body] 25: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.