Created
March 27, 2018 12:20
-
-
Save jhonata-menezes/955dc0439cd5f75a7fa2bd30ac48f13f to your computer and use it in GitHub Desktop.
ttfb with python 3.6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
from urllib import request | |
host = "https://www.buscape.com.br/notebook" | |
opener = request.build_opener() | |
request = request.Request(host) | |
request.add_header('user-agent', 'firefox') | |
start = time.time() | |
resp = opener.open(request) | |
# read one byte | |
resp.read(1) | |
ttfb = time.time() - start | |
print("The TTFirst Byte of " +host+" is: "+str(ttfb)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment