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
|
||||
|
||||
def call(context : HTTP::Server::Context)
|
||||
time = Time.monotonic
|
||||
call_next(context)
|
||||
elapsed_text = elapsed_text(Time.monotonic - time)
|
||||
elapsed_time = Time.measure { call_next(context) }
|
||||
elapsed_text = elapsed_text(elapsed_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