local-ch / lhc

🚀 Advanced HTTP Client for Ruby. Fueled with interceptors.
GNU General Public License v3.0
43 stars 1 forks source link

LHC::Response#time got the numbers all wrong #130

Closed 10xSebastian closed 6 years ago

10xSebastian commented 6 years ago

PATCH

I really don't know for how long this is in there, checked https://github.com/typhoeus/typhoeus and https://github.com/typhoeus/ethon and it seems typhoeus Responses returned seconds for time ever since.

That bug made consuming apps and interceptors (like the logging interceptor) retrieve milliseconds, even though they thought it's seconds (according to the documentation):

> response = LHC.get('http://www.google.com/')
> response.time
 => 99.75 
> response.time_ms
 => 0.09975

Now

It's patched, time returns seconds properly, and time_ms returns milliseconds 🙈