c440f3b05b
Tools for timing python code. PR: 247354 Submitted by: Gilbert Morgan <gmm@tutanota.com>
14 lines
308 B
Text
14 lines
308 B
Text
Time execution of blocks of code.
|
|
|
|
Tested against python 3.6+, but should work with other versions.
|
|
|
|
The easiest way to time something is with tic and toc:
|
|
|
|
import time
|
|
from ttictoc import tic,toc
|
|
tic()
|
|
time.sleep(1)
|
|
elapsed = toc()
|
|
print('Elapsed time:',elapsed)
|
|
|
|
WWW: https://github.com/hector-sab/ttictoc
|