- 授权协议: 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}}
Uberland
Alex Rosenblat / University of California Press / 2018-11-19 / GBP 21.00
Silicon Valley technology is transforming the way we work, and Uber is leading the charge. An American startup that promised to deliver entrepreneurship for the masses through its technology, Uber ins......一起来看看 《Uberland》 这本书的介绍吧!
