Why do I get the same start and end time while using time.time() in python?

Viewed 37

The code I am using is:

import numpy as np
import time

a = np.random.randint(0,30,(6,6))
b = np.random.randint(0,30,(6,6))
start_time = time.time()
c = a @ b
end_time = time.time()
print(end_time-start_time)

I am getting the same value in start_time and end_time. I was working on a different project and realized this issue and just wrote this quick code to check it. Is this possible and how? I am aware of the possibility of using timeit library, but even with the time library I should get some small value for this computation, it cannot be absolutely 0, right?

0 Answers
Related