jaygooby / ttfb.sh

Measures time-to-first-byte in seconds, for single or multiple URLs. Can calculate fastest, slowest & median TTFB values, and optionally log all response headers. Uses curl and the calculation `%{time_starttransfer} - %{time_appconnect}` which doesn't include any connection overhead, to better approximate devtool’s TTFB figure.
MIT License
245 stars 40 forks source link

Can produce negative numbers #12

Open dominicletz opened 3 years ago

dominicletz commented 3 years ago

Amazing tool, thanks for creating!

For some requests, ttfb seems to be producing negative numbers. Possibly this is for failed requests? I'm attaching a screenshot from one such case when running verbosely:

Selection_694

jaygooby commented 3 years ago

Ah thanks for this. I'll try and add some test cases that can reproduce it

jaygooby commented 2 years ago

Yikes, still haven't tried to fix this yet, but I now do have a test suite, so it should be a bit easier.