Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
import requests
import time
def payment():
headers={ 'Content-Type': 'application/json', }, json={ 'amount': 1 })
start = time.time()
for i in range(500):
resp = payment()
print('The payment number {} has the status code {}'.format(i, resp.status_code))
if resp.status_code != 200:
print('The status code is not 200 hence breaking off count is {}'.format(i))
end = time.time()
print('Time elapsed ', end - start)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment