Skip to content

Instantly share code, notes, and snippets.

@ClayRabbit
Forked from sandeepraju/ttfb.sh
Last active October 23, 2023 06:03
Show Gist options
  • Save ClayRabbit/7f700322b3250250eec10c08cb84bd85 to your computer and use it in GitHub Desktop.
Save ClayRabbit/7f700322b3250250eec10c08cb84bd85 to your computer and use it in GitHub Desktop.
curl command to check the time to first byte
#!/bin/sh
# file: ttfb.sh
# curl command to check the time to first byte
# ** usage **
# 1. ./ttfb.sh "https://google.com"
# 2. seq 10 | xargs -Iz ./ttfb.sh "https://google.com"
curl -so/dev/null -w"Connect: %{time_connect} TTFB: %{time_starttransfer} Total time: %{time_total} \n" "$1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment