# Slow request? Measure it with one curl line

> Stop arguing about the network. This curl line breaks down DNS, connect, TLS and server time.

Source: https://fullbytedeveloper.com/blog/curltiming
Published here: 2026-11-12

Stop arguing about the network. Measure it.

## The one-liner

```bash
curl -s -o /dev/null -w 'dns %{time_namelookup} connect %{time_connect} tls %{time_appconnect} ready %{time_pretransfer} first-byte %{time_starttransfer} total %{time_total} code %{http_code}\n' https://example.com/
```

## How to read it

Every number counts from the start of the request, so read the gaps:

| Gap | What it tells you |
|-----|-------------------|
| dns big | Slow name lookup (resolver) |
| connect minus dns | Reaching the host |
| tls minus connect | TLS handshake (0 on plain http) |
| first-byte minus ready | The server thinking, plus one network round trip |
| total minus first-byte | A big or slow response |

## Example output

A server that waits 1.5 seconds before answering:

```text
dns 0.000008 connect 0.000241 tls 0.000000 ready 0.000255 first-byte 1.505788 total 1.505824 code 200
```

Everything near 0 until first-byte. That is the server.

## Make it reusable

Put the format string in a file called `timing.txt`:

```text
dns %{time_namelookup} connect %{time_connect} tls %{time_appconnect} ready %{time_pretransfer} first-byte %{time_starttransfer} total %{time_total} code %{http_code}\n
```

Then run:

```bash
curl -s -o /dev/null -w @timing.txt YOUR_URL
```

Same output, one short command, reusable on any URL.

Send this to the teammate who blames the network every time a request feels slow.

## Sources

1. [curl man page: --write-out variables](https://curl.se/docs/manpage.html)
