推荐学习书目
› 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 · 4873 views
    This topic created in 4506 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
    77421
    Jul 16, 2014❤️1
    1
    代码头部: begin = time.time()

    尾部 : time.time() - begin

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