문제

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.

올바른 솔루션이 없습니다

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top