-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
31 lines (22 loc) · 781 Bytes
/
main.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
import time
def test_function():
pass
if __name__ == "__main__":
# Number of Iterations
n = 994000000 # 8999994000000
print("[+] Number of Iterations: " + str(n))
for k in range(3):
print("[+] Test Number: " + str(k+1))
# Test1
time1_no_function = time.time_ns()
for i in range(n):
pass
time2_no_function = time.time_ns()
# Test2
time1_with_function = time.time_ns()
for i in range(n):
test_function()
time2_with_function = time.time_ns()
# Echo
print("[->] Time without Function: " + str(time2_no_function - time1_no_function) + "ns")
print("[->] Time with a Function: " + str(time2_with_function - time1_with_function) + "ns")