我发现这段代码是每次响应的时间,但是我不确定g应该从哪里来。什么g啊
@app.before_request
def before_request():
g.start = time.time()
@app.teardown_request
def teardown_request(exception=None):
diff = time.time() - g.start
print diff
相关分类