%timeit

 

# Insert 100,000 values at the front of the list (index=0)
c0 = []
t_insert = %timeit -o -n1000 -r100 c0.insert(0, 'a')
# Append 100,000 values at the end of the list
c1 = []
t_append = %timeit -o -n1000 -r100 c1.append('a')

 

jupyter的 %timeit的使用

相关文章:

  • 2021-06-20
  • 2022-01-09
  • 2022-12-23
  • 2021-09-28
  • 2021-07-30
  • 2021-10-28
  • 2021-12-11
猜你喜欢
  • 2023-02-27
  • 2022-01-19
  • 2021-08-10
  • 2021-11-08
  • 2021-08-16
  • 2022-12-23
  • 2021-08-19
相关资源
相似解决方案