How do I measure elapsed time in Python?

I want to measure the time it took to execute a function. I couldn't get timeit to work:

import timeit
start = timeit.timeit()
print("hello")
end = timeit.timeit()
print(end - start)

← Назад к списку