From 7937c083e464fd5f94a428cb356f600a94b24d4a Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 25 Jun 2016 09:51:22 +0530 Subject: [PATCH] Output running times for commands during setup --- setup/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/setup/__init__.py b/setup/__init__.py index 12097a387c..8662a824d0 100644 --- a/setup/__init__.py +++ b/setup/__init__.py @@ -6,7 +6,7 @@ __license__ = 'GPL v3' __copyright__ = '2009, Kovid Goyal ' __docformat__ = 'restructuredtext en' -import sys, re, os, platform, subprocess +import sys, re, os, platform, subprocess, time is64bit = platform.architecture()[0] == '64bit' iswindows = re.search('win(32|64)', sys.platform) @@ -172,12 +172,15 @@ class Command(object): self.info('*\n') def run_cmd(self, cmd, opts): + from setup.commands import command_names cmd.pre_sub_commands(opts) for scmd in cmd.sub_commands: self.run_cmd(scmd, opts) + st = time.time() self.running(cmd) cmd.run(opts) + self.info('* %s took %.1f seconds' % (command_names[cmd], time.time() - st)) def run_all(self, opts): self.run_cmd(self, opts)