Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import requests
- import time
- start_time = time.time() # record the start time
- response = requests.get('https://httpbin.org') # make GET request
- end_time = time.time() # record the end time
- # calculate the time taken
- elapsed_time = end_time - start_time
- # optionally, do something with the response and the time taken
- # print(f"Response: {response.data}")
- print(f"Time taken: {elapsed_time} seconds")
- #... Time taken: 1.07.. seconds
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement