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
|
end
|
||||||
|
|
||||||
def call(context : HTTP::Server::Context)
|
def call(context : HTTP::Server::Context)
|
||||||
time = Time.now
|
time = Time.monotonic
|
||||||
call_next(context)
|
call_next(context)
|
||||||
elapsed_text = elapsed_text(Time.now - time)
|
elapsed_text = elapsed_text(Time.monotonic - time)
|
||||||
@io << time << ' ' << context.response.status_code << ' ' << context.request.method << ' ' << context.request.resource << ' ' << elapsed_text << '\n'
|
@io << Time.now << ' ' << context.response.status_code << ' ' << context.request.method << ' ' << context.request.resource << ' ' << elapsed_text << '\n'
|
||||||
context
|
context
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue