improvement: use Time.measure
This commit is contained in:
parent
c6ac5232db
commit
14ed2aa8bf
1 changed files with 2 additions and 3 deletions
|
@ -5,9 +5,8 @@ module Kemal
|
||||||
end
|
end
|
||||||
|
|
||||||
def call(context : HTTP::Server::Context)
|
def call(context : HTTP::Server::Context)
|
||||||
time = Time.monotonic
|
elapsed_time = Time.measure { call_next(context) }
|
||||||
call_next(context)
|
elapsed_text = elapsed_text(elapsed_time)
|
||||||
elapsed_text = elapsed_text(Time.monotonic - time)
|
|
||||||
@io << Time.now << ' ' << 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