Recently I have found this question:
Find out time it took for a python script to complete execution
The highest voted answer suggests that for timing an execution, I should use difference in datetime.now()
calls. I have seen people using time.time()
, but never datetime.now()
for this purpose. This video at 5:30 suggests to use time.perf_counter()
(which was not mentioned in any of the answers so I added it).
Is using datetime.now()
equivalent to using time.perf_counter()
, with the output having better human readability, or there are caveats?