-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
56 lines (35 loc) · 1.32 KB
/
test.py
File metadata and controls
56 lines (35 loc) · 1.32 KB
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
47
48
49
50
51
52
53
54
55
56
from pack.abc import dbstore
import concurrent.futures
import time,threading
start = time.perf_counter()
threads = []
obj=dbstore()
# This loop is to add Keys in DB STORE
for i in range(4):
secs = [('name','vikas',113),('street','canal lane',3),('city','hyderabad',2),('phone2',9392322121,322),('states','Telangana',1)]
# obj.add(secs[i][0],secs[i][1],secs[i][2])
t = threading.Thread(target=obj.add , args=[secs[i][0],secs[i][1],secs[i][2]])
t.start()
threads.append(t)
for thread in threads:
thread.join()
# This loop is to READ Keys in DB STORE
for i in range(4):
secs = [('name','vikas',0),('street','canal lane',3),('city','hyderabad',2),('phone2',9392322121,322),('states','Telangana',1)]
# obj.add(secs[i][0],secs[i][1],secs[i][2])
t = threading.Thread(target=obj.read , args=[secs[i][0],secs[i][1],secs[i][2]])
t.start()
threads.append(t)
for thread in threads:
thread.join()
# This loop is to DELETE Keys in DB STORE
for i in range(1):
secs = [('state','Telangana',1)]
t = threading.Thread(target=obj.delete , args=[secs[i][0],secs[i][1],secs[i][2]])
t.start()
threads.append(t)
for thread in threads:
thread.join()
finish = time.perf_counter()
#measure The Performance of it...
print(f'Finished in {round(finish-start, 2)} second(s)')