Simple curl:
# Basic HTTP latency test
curl -w "Connect: %{time_connect}s\nTTFB: %{time_starttransfer}s\nTotal: %{time_total}s\n" -o /dev/null -s http://example.com
More detailed:
# More detailed timing breakdown
curl -w "@-" -o /dev/null -s http://example.com <<'EOF'
time_namelookup: %{time_namelookup}s\n
time_connect: %{time_connect}s\n
time_appconnect: %{time_appconnect}s\n
time_pretransfer: %{time_pretransfer}s\n
time_redirect: %{time_redirect}s\n
time_starttransfer: %{time_starttransfer}s\n
----------\n
time_total: %{time_total}s\n
EOF
# Install httping
sudo apt install httping # Debian/Ubuntu
sudo yum install httping # RHEL/CentOS
sudo pacman -S httping # Arch
# User httping
httping -c 10 http://example.com
httping -c 10 -p 443 https://example.com