-
Notifications
You must be signed in to change notification settings - Fork 1
/
temp.py
46 lines (36 loc) · 886 Bytes
/
temp.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import time
import requests
import threading
ttl = 0
# def post(url, data):
# def get_url(url):
# global ttl
# now = time.time()
# for i in url:
# requests.get(i)
# tkn = time.time() - now
# ttl += tkn
#
#
# threads = list()
# for j in range(100):
# for i in range(8):
# x = threading.Thread(target=get_url, args=[
# ['http://127.0.0.1:8000/api/books/all']]
# )
# threads.append(x)
# x.start()
#
# for index, thread in enumerate(threads):
# thread.join()
url = 'http://127.0.0.1:8000/api/cart/checkout'
data = {
"shipping_details": {
"name": "Priyansh Singh",
"address": "113 North City Pilibhit Road Bareilly",
"contact_number": "9412666633",
"email": "[email protected]"
}
}
x = threading.Thread()
print('taken -> ', ttl)