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

  • 关于我们
  • 免责声明