From 0c4301407a04bebe15488640cc26f9cf90f30563 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Wed, 23 Oct 2013 22:19:06 -0400 Subject: Simple timing of commands. --- coverage/cmdline.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/coverage/cmdline.py b/coverage/cmdline.py index 0881313e..ea112a8b 100644 --- a/coverage/cmdline.py +++ b/coverage/cmdline.py @@ -1,6 +1,6 @@ """Command-line support for Coverage.""" -import optparse, os, sys, traceback +import optparse, os, sys, time, traceback from coverage.backward import sorted # pylint: disable=W0622 from coverage.execfile import run_python_file, run_python_module @@ -717,7 +717,11 @@ def main(argv=None): if argv is None: argv = sys.argv[1:] try: + start = time.clock() status = CoverageScript().command_line(argv) + end = time.clock() + if 0: + print("time: %.3fs" % (end - start)) except ExceptionDuringRun: # An exception was caught while running the product code. The # sys.exc_info() return tuple is packed into an ExceptionDuringRun -- cgit v1.2.1