Tools
Products
TTFB Checker
What is TTFB?
TTFB stands for Time To First Byte, and is the time that browser waits for server to respond with the first byte.
How to calculate TTFB with cURL?
Use the following cURL command to get the timing information about a given URL.
$ curl -o /dev/null -w "pretransfer: %{time_pretransfer} | starttransfer: %{time_starttransfer}" http://news.bbc.co.uk # pretransfer: 0.272 | starttransfer: 0.345
- pretransfer - Time in seconds from start until just before file transfer begins
- starttransfer - Time in seconds until the first byte is about to be transferred
Then calculate the time to first byte using the formula:
starttransfer - pretransfer = ttfb # 0.345 - 0.272 = 0.073 sec # 0.073 * 1000 = 73 ms
Social share
Share this tool with friends and colleagues on your favorite social network: