Commit ed9a0833 authored by pam@chromium.org's avatar pam@chromium.org

Report computation time before showing a prompt, so the response time

isn't included in the calculation.

BUG=none
TEST=submit change with presubmit warning, note reported time

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@25806 0039d316-1c4b-4281-b951-d872f2087c98
parent b671b223
......@@ -866,6 +866,11 @@ def DoPresubmitChecks(change,
may_prompt=False):
error_count += 1
output_stream.write('\n')
total_time = time.time() - start_time
if total_time > 1.0:
print "Presubmit checks took %.1fs to calculate." % total_time
if not errors and warnings and may_prompt:
output_stream.write(
'There were presubmit warnings. Sure you want to continue? (y/N): ')
......@@ -873,9 +878,6 @@ def DoPresubmitChecks(change,
if response.strip().lower() != 'y':
error_count += 1
total_time = time.time() - start_time
if total_time > 1.0:
print "Presubmit checks took %.1fs to calculate." % total_time
global _ASKED_FOR_FEEDBACK
# Ask for feedback one time out of 5.
if (len(results) and random.randint(0, 4) == 0 and not _ASKED_FOR_FEEDBACK):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment