diff --git a/appPublic/timecost.py b/appPublic/timecost.py index 5d20596..190496b 100644 --- a/appPublic/timecost.py +++ b/appPublic/timecost.py @@ -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)) diff --git a/appPublic/version.py b/appPublic/version.py index 6e42b5c..824228c 100644 --- a/appPublic/version.py +++ b/appPublic/version.py @@ -1 +1 @@ -__version__ = '5.1.22' +__version__ = '5.1.23'