python -mtimeit in windows
2010-06-04 23:52
483 查看
$ python -mtimeit -s"from math import sqrt; x = 123" "x**.5"
1000000 loops, best of 3: 0.445 usec per loop
$ python -mtimeit -s"from math import sqrt; x = 123" "sqrt(x)"
1000000 loops, best of 3: 0.574 usec per loop
$ python -mtimeit -s"import math; x = 123" "math.sqrt(x)"
1000000 loops, best of 3: 0.727 usec per loop
from http://stackoverflow.com/questions/842245/which-is-more-accurate-x-5-or-math-sqrtx
1000000 loops, best of 3: 0.445 usec per loop
$ python -mtimeit -s"from math import sqrt; x = 123" "sqrt(x)"
1000000 loops, best of 3: 0.574 usec per loop
$ python -mtimeit -s"import math; x = 123" "math.sqrt(x)"
1000000 loops, best of 3: 0.727 usec per loop
from http://stackoverflow.com/questions/842245/which-is-more-accurate-x-5-or-math-sqrtx
相关文章推荐
- Mouse and keyboard operation in windows using python
- python: how to delete a given item if it exist in the list
- Windows Intune, 让企业 IT 如履平地
- python windows环境下 pip install itchat 失败的原因
- Sublime Text 2 for C/C++ and Python in Windows
- 转载:Setup OpenCV for Python in Windows
- Thrift Python in windows
- selenium+python自动化88-批量操作循环点击报错:Element not found in the cache - perhaps the page has changed since it was looked up
- The next Industry Standard in IT Monitoring, a python implementation Nagios like tool --- Shinken
- windows下用Python连接mysql报错问题“MySQLdb in Python: “Can't connect to MySQL server on 'localhost'””
- python error when compile file in windows
- Windows API Hooking in Python
- How can I force Python's file.write() to use the same newline format in Windows as in Linux (“\r\n”
- windows下 OpenCV in Python 配置
- Python Vim Configuration(Vim 设置成Python编辑器)in Windows
- 【Python错误】windows下使用pip/easy_install提示Fatal error in launcher: Unable to create process using...
- PostgreSQL 9.1: Installing plpythonu/plpython3u (Python) in Windows
- windows 安装MySQL-python-1.2.4b4.win32-py2.7提示which was not found in the registry
- IT薪酬报告:Java、Apex、Python、Windows技术最赚钱