This commit is contained in:
yumoqing 2022-10-08 12:50:04 +08:00
parent 9d0dc1cccc
commit cbe9ef259e
2 changed files with 8 additions and 8 deletions

View File

@ -20,12 +20,6 @@ class TimeCost:
def clear(self):
timerecord = {}
def getTimeCost(self,name):
x = timerecord.get(name,[])
if len(x) == 0:
return 0,0,0
return len(x), sum(x), sum(x)/len(x)
@classmethod
def clear_all(self):
timerecord = {}
@ -36,7 +30,13 @@ class TimeCost:
@classmethod
def show(self):
def getTimeCost(name):
x = timerecord.get(name,[])
if len(x) == 0:
return 0,0,0
return len(x), sum(x), sum(x)/len(x)
print('TimeCost ....')
for name in timerecord.keys():
print(name, * self.getTimeCost(name))
print(name, * getTimeCost(name))

View File

@ -1 +1 @@
__version__ = '5.1.22'
__version__ = '5.1.23'