logo
  • 教程列表
  • SO官方文檔
  • 剖析
    • IPython 中的 timeit 和 timeit
    • timeit() 函式
    • timeit 命令列
    • 命令列中的行分析器
    • 使用 cProfile(首選 Profiler)
  1. StackOverflow 文件
  2. Python Language 教程
  3. 剖析
  4. timeit 命令列

timeit 命令列

Created: November-22, 2018

剖析數字的連線

python -m timeit "'-'.join(str(n) for n in range(100))"
10000 loops, best of 3: 29.2 usec per loop

python -m timeit "'-'.join(map(str,range(100)))"
100000 loops, best of 3: 19.4 usec per loop
  • 命令列中的行分析器
  • timeit() 函式

Copyright © 2018. All right reserved

tastones.com 备案号:鲁ICP备18045372号-1

  • 關於本站
  • 免責聲明