Simple way to measure cell execution time in ipython notebook

后端 未结 12 1421
春和景丽
春和景丽 2020-11-29 15:17

I would like to get the time spent on the cell execution in addition to the original output from cell.

To this end, I tried %%timeit -r1 -n1 but it does

12条回答
  •  再見小時候
    2020-11-29 15:48

    import time
    start = time.time()
    "the code you want to test stays here"
    end = time.time()
    print(end - start)
    

提交回复
热议问题