Get a more precise timer in python
-
11-11-2019 - |
سؤال
Given this example code:
start = time.clock()
while (abs(x**2 - userInput) > epsilon):
x = 0.5 * (x + (userInput/x))
count = count+1
end = time.clock()
print(end-start)
And given that this operation, take very little time, how can I get a more precise timer?
I have looked at timeit
module but could not figure out how to use it or whether it is what I want.
لا يوجد حل صحيح
لا تنتمي إلى StackOverflow