Discussion about this post

User's avatar
Ro's avatar
Jul 22Edited

Great post, Erfan! Just a quick tip, instead of `time.time()` use `time.perf_counter()`. The `time.time()` method tells the current time of your device whereas `time.perf_counter` uses relative time [Ref1]. From [Ref2]:

"It's measured (perf_counter) using a CPU counter and, as specified in the docs, should only be used to measure time intervals"

Ref1: https://blog.dailydoseofds.com/p/dont-use-timetime-to-measure-execution

Ref2: https://stackoverflow.com/questions/66036844/time-time-or-time-perf-counter-which-is-faster

Expand full comment

No posts