The code below returns the execution time in seconds.
In [1]:
import time
start = time.time()
for i in range(1000):
x = i * i
end = time.time()
print(end - start)
The code below returns the execution time in seconds.
import time
start = time.time()
for i in range(1000):
x = i * i
end = time.time()
print(end - start)