diff options
Diffstat (limited to 'lib/rack/runtime.rb')
-rw-r--r-- | lib/rack/runtime.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/rack/runtime.rb b/lib/rack/runtime.rb index 1bd411fd..83d6c0ca 100644 --- a/lib/rack/runtime.rb +++ b/lib/rack/runtime.rb @@ -12,13 +12,14 @@ module Rack @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] |