标签:port 装饰器 bubble print sleep name star art import
__author__ = "bubble"
import time
def timer(name):
print(name)
def fuck(func):
def get_time(*agrs, **kwargs):
start_time = time.time()
func(*agrs, **kwargs)
end_time = time.time()
print("耗时%s" % (end_time - start_time))
return get_time
return fuck
@timer(name="qixuelong") #say_hello = timer()
def say_hello(name="111", age=7):
time.sleep(3)
print("名字%s年龄%d" % (name, age))
say_hello()
标签:port 装饰器 bubble print sleep name star art import
原文地址:http://www.cnblogs.com/cancelbubble/p/6913169.html