Skip to content

Instantly share code, notes, and snippets.

@zelic91
Created June 9, 2021 11:23
Show Gist options
  • Save zelic91/78d7bb90a63a7f30f3064e978caf6e38 to your computer and use it in GitHub Desktop.
Save zelic91/78d7bb90a63a7f30f3064e978caf6e38 to your computer and use it in GitHub Desktop.
CURL with various time info
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" "$@"
}
curl_time -X POST -H "Content-Type: application/json" -d '{"key": "val"}' https://postman-echo.com/post
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment