Just a simple command that does the basics:
curl domain.tld -s -o output -w 'dns: %{time_namelookup} sec\nconnect: %{time_connect} sec\nuntil first byte: %{time_starttransfer} sec\ntotal: %{time_total} sec\n'
Which results in:
dns: 0,002012 sec
connect: 0,014331 sec
until first byte: 0,091226 sec
total: 0,113247 sec
And on Mac, to repeat add repeat {count}
:
repeat 5 curl domain.tld -s -o output -w 'dns: %{time_namelookup} sec\nconnect: %{time_connect} sec\nuntil first byte: %{time_starttransfer} sec\ntotal: %{time_total} sec\n'
You could also add something like the below to your .bashrc
or .zshrc
(or whatever shell you use), for a simple helper function:
function perf {
curl -o /dev/null -s -w "Bytes: size_download: %{size_download} bytes\n%{time_connect} + %{time_starttransfer} = %{time_total}\n" "$1"
}
And then run something like perf google.com
.