DEV Community

Discussion on: How to Performance Test Python Code: timeit, cProfile, and More

Collapse
 
misobelica profile image
Mišo

It would be better to use perf_counter instead of the datetime.datetime.now() because it is intended to it. You could get really weird results when changing summer/winter time or overlap second. More on why also in docs.python.org/3/library/time.htm... 🙂