1 eventlet性能探究
测试代码如下:
# -*- encoding: utf-8 -*-
from datetime import datetime
import time
import eventlet
eventlet.monkey_patch()
# eventlet.monkey_patch(all=False,
# os=True,
# select=True,
# socket=True,
# thread=False,
# time=True)
def timeHelper(func):
def wrapper(*args, **kwargs):
try:
start = datetime.now()
info = "############ function: {func} Begin , start: {start} ##########" .format(
func=func.__name__,
start=str(start))
print info
result = func(*args, **kwargs)
end = datetime.now()
diff = end - start
info = "##### funct