What is the suggested way to measure function duration in python? I have seen the following:
t0 = time.time()
# do something()
duration = time.time() - t0
and
t0 = time.perf_counter()
# do something()
duration = time.perf_counter() - t0
What are the differences, and which should be used for profiling, if either?