Sha256: ee5b783c2dc522b0b835a318d2b8d15be7227ff547783aa05100bcce053772ba
Contents?: true
Size: 344 Bytes
Versions: 8
Compression:
Stored size: 344 Bytes
Contents
class Timing def initialize(app) @app = app end def call(env) env['Timing-Start'] = Time.now.to_i ts = Time.now status, headers, body = @app.call(env) elapsed_time = Time.now - ts puts "Timing: #{env['REQUEST_METHOD']} #{env['REQUEST_URI']} #{elapsed_time.round(3)}" return [status, headers, body] end end
Version data entries
8 entries across 8 versions & 1 rubygems