-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.py
40 lines (30 loc) · 834 Bytes
/
test.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
import time
import numpy as np
import hoangdz
def sum_l(data):
s = 0
for e in data:
s += e
return s
a = int(input("enter a: "))
b = int(input("enter b: "))
print("sum: ", hoangdz.add(a, b))
print("sum: ", hoangdz.add1(a, b))
print("multiple: ", hoangdz.mul(a, b))
print("type sum: ", type(hoangdz.add(a, b)))
print(hoangdz.hello())
hoangdz.printSt(input("enter something: "))
print("Array: ", hoangdz.returnArrayWithInput(100))
data = [i for i in range(1_000_000)]
start = time.time()
print(f"Sum: {hoangdz.sum_list(data)}")
end = time.time()
print(f"hoangdz.sum_list run in: {end - start}")
start = time.time()
print(f"Sum: {sum_l(data)}")
end = time.time()
print(f"sum_l run in: {end - start}")
start = time.time()
print(f"Sum: {np.sum(data)}")
end = time.time()
print(f"np.sum run in: {end - start}")