Skip to content

Instantly share code, notes, and snippets.

@hosni
Created January 30, 2022 07:45
Show Gist options
  • Save hosni/48ffacb6a761e3b5d012e5a54f616b81 to your computer and use it in GitHub Desktop.
Save hosni/48ffacb6a761e3b5d012e5a54f616b81 to your computer and use it in GitHub Desktop.
A function to measure the request time to a server, put it in your .zshrc or .bashrc
curl_time() {
curl -so /dev/null -w "\
namelookup: %{time_namelookup}s\n\
connect: %{time_connect}s\n\
appconnect: %{time_appconnect}s\n\
pretransfer: %{time_pretransfer}s\n\
redirect: %{time_redirect}s\n\
starttransfer: %{time_starttransfer}s\n\
-------------------------\n\
total: %{time_total}s\n" "$@"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment