From e9ba6c8a27599fb3356b895f12559869f2bc75b2 Mon Sep 17 00:00:00 2001 From: "Shedbalkar, Akshay" Date: Wed, 29 Jun 2022 11:58:46 +0200 Subject: [PATCH] Include a cumulative total in python --- vim-plugins-profile.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vim-plugins-profile.py b/vim-plugins-profile.py index 67e5e47..e74bee9 100755 --- a/vim-plugins-profile.py +++ b/vim-plugins-profile.py @@ -276,11 +276,14 @@ def print_summary(self, n): avg_data = self.average_data() # Sort by average time rank = 0 + total = 0 for name, time in self.__sort_data(avg_data)[:n]: rank += 1 + total += time print("%i\t%7.3f %s" % (rank, time, name)) print(''.center(length, '=')) + print('\nTotal startup time: ' + str(round(total,2))) @staticmethod def __sort_data(d, reverse=True):