lib/rack/runtime.rb in rack-1.6.0.beta vs lib/rack/runtime.rb in rack-1.6.0.beta2
- old
+ new
@@ -10,16 +10,17 @@
@app = app
@header_name = "X-Runtime"
@header_name << "-#{name}" if name
end
+ FORMAT_STRING = "%0.6f"
def call(env)
start_time = Time.now
status, headers, body = @app.call(env)
request_time = Time.now - start_time
if !headers.has_key?(@header_name)
- headers[@header_name] = "%0.6f" % request_time
+ headers[@header_name] = FORMAT_STRING % request_time
end
[status, headers, body]
end
end