Properly measure request time using Time.monotonic
This commit is contained in:
parent
45a508c27d
commit
c6ac5232db
1 changed files with 3 additions and 3 deletions
|
@ -5,10 +5,10 @@ module Kemal
|
|||
end
|
||||
|
||||
def call(context : HTTP::Server::Context)
|
||||
time = Time.now
|
||||
time = Time.monotonic
|
||||
call_next(context)
|
||||
elapsed_text = elapsed_text(Time.now - time)
|
||||
@io << time << ' ' << context.response.status_code << ' ' << context.request.method << ' ' << context.request.resource << ' ' << elapsed_text << '\n'
|
||||
elapsed_text = elapsed_text(Time.monotonic - time)
|
||||
@io << Time.now << ' ' << context.response.status_code << ' ' << context.request.method << ' ' << context.request.resource << ' ' << elapsed_text << '\n'
|
||||
context
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue