推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
pc10201
V2EX  ›  Python

如何统计 tornado 的 AsyncHTTPClient 的总的执行时间?

  •  
  •   pc10201 · Jul 16, 2014 · 4513 views
    This topic created in 4340 days ago, the information mentioned may be changed or developed.
    感觉异步很难理解啊
    比如我用tornado的异步HTTP客户端,采集百度首页100次
    怎么用python time模块统计全部执行完这100次采集所耗的时间?
    4 replies    2014-07-17 09:55:28 +08:00
    77421
        1
    77421  
       Jul 16, 2014   ❤️ 1
    代码头部: begin = time.time()

    尾部 : time.time() - begin

    输出
    ChiChou
        2
    ChiChou  
       Jul 16, 2014
    @77421 他说的是异步调用
    hoogle
        3
    hoogle  
       Jul 17, 2014 via iPhone
    一楼的时间取最大值
    chjuheng
        4
    chjuheng  
       Jul 17, 2014
    tornado.gen + yield
    这样时间你想怎么统计都行了。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3365 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 42ms · UTC 00:19 · PVG 08:19 · LAX 17:19 · JFK 20:19
    ♥ Do have faith in what you're doing.