Python timeit

From wikinotes
Revision as of 20:04, 6 May 2018 by Will (talk | contribs) (Created page with "<source lang="python"> from timeit import Timer Timer('t=a; a=b; b=t', 'a=1; b=2').timeit() #> 0.088729 time python2 lute.py ## use bash to simply time how long the scr...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
from timeit import Timer

Timer('t=a; a=b; b=t', 'a=1; b=2').timeit()
#> 0.088729
time python2 lute.py							## use bash to simply time how long the script takes to run.