python输出指定函数运行时间的装饰器,python函数,def GetRunTi
python输出指定函数运行时间的装饰器,python函数,def GetRunTi
def GetRunTime(func): def check(*args, **args2): startTime = datetime.datetime.now() f = func(*args,**args2) endTime = datetime.datetime.now() print(endTime-startTime) return f return check
调用方式
def test(): print("hello world")GetRunTime(test)
相关内容
- python循环中使用break语句终止循环,pythonbreak,#!/usr/bin
- python for each遍历字典,pythoneach,D = {'a':1,
- python中使用列表代码演示,python列表代码演示,#!/usr/b
- python 中文件路径和url的相互转换,python相互转换,impo
- python获得当前上网的ip地址,python获得当前ip,import url
- python里的map函数替代循环的范例演示,pythonmap,def add1
- python 使用socket远程发送命令并获得执行结果,pythonso
- python将英文单词表示的数字转换成阿拉伯数字,python阿
- python3计算常数e,python3常数e,import math
- python简单的计算过期时间的代码,python计算过期时间
评论关闭