To time a particular code block in Python, do this:
import time
t = time.time()
#<code_block>
print(f'code-block-name:{time.time()-t})
[Courtesy: this]
import time
t = time.time()
#<code_block>
print(f'code-block-name:{time.time()-t})
[Courtesy: this]
No comments:
Post a Comment