- 授权协议: BSD
- 开发语言: Python
- 操作系统: 跨平台
- 软件首页: https://github.com/davidcrawford/chronic
- 软件文档: https://github.com/davidcrawford/chronic
软件介绍
Chronic 介于简单的定时器和分析器。通过添加修饰符或包装代码语句来获得程序执行时间。Chronic 跟踪调用层次结构来告诉你时间块内执行其他的块。附加一个事件侦听器来记录你想要的时间。
示例代码:
import chronic
from pprint import pprint
@chronic.time
def time_one():
pass
@chronic.time
def time_two():
with chronic.Timer('block2'):
print chronic.stack
# ('time_two', 'block2')
pprint(chronic.timings)
# prints local view of timings
# {'block2': {'average_elapsed': 1.0967254638671875e-05,
# 'count': 1,
# 'total_elapsed': 1.0967254638671875e-05}}
with chronic.Timer('block1'):
time_one()
pprint(chronic.timings)
def print_done(elapsed, timings, stack):
print stack
pprint(timings)
time_one()
chronic.post_timing.connect(print_done)
time_one()
# []
# 9.5367431640625e-07
# {'average_elapsed': 9.5367431640625e-07,
# 'count': 2,
# 'total_elapsed': 1.9073486328125e-06}
chronic.post_timing.disconnect(print_done)
time_two()
# ['time_two', 'block2']
# {'block2': {'average_elapsed': 5.9604644775390625e-06,
# 'count': 1,
# 'total_elapsed': 5.9604644775390625e-06}}
HTML Dog
Patrick Griffiths / New Riders Press / 2006-11-22 / USD 49.99
For readers who want to design Web pages that load quickly, are easy to update, accessible to all, work on all browsers and can be quickly adapted to different media, this comprehensive guide represen......一起来看看 《HTML Dog》 这本书的介绍吧!
