1 def run_time(func): 2 def new_fun(*args,**kwargs): 3 t0 = time.time() 4 print('star time: %s' % (time.strftime('%x', time.localtime()))) 5 back = func(*args, **kwargs) 6 print('end time: %s' % (time.strftime('%x', time.localtime()))) 7 print('run time: %s' % (time.time() - t0)) 8 return back 9 return new_fun