From a6084939fe93b9b727537e39beb06965d95dc370 Mon Sep 17 00:00:00 2001 From: Matt Craighead Date: Wed, 26 Oct 2011 21:33:07 -0700 Subject: [PATCH] print transform, compile, and run times separately --- pythonc.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pythonc.py b/pythonc.py index ca3e9dc..f169f16 100755 --- a/pythonc.py +++ b/pythonc.py @@ -22,9 +22,17 @@ if not args: path = args[0] base = os.path.splitext(path)[0] +start = time.time() subprocess.check_call(['python3', 'transform.py', path, '%s.cpp' % base]) +elapsed = time.time() - start +print('Transform time: %.4fs' % elapsed) + +start = time.time() subprocess.check_call(['c++'] + gcc_flags + ['%s.cpp' % base, '-o', base]) +elapsed = time.time() - start +print('Compile time: %.4fs' % elapsed) + start = time.time() subprocess.check_call(['./%s' % base] + args[1:]) elapsed = time.time() - start -print('Total time: %ss' % elapsed) +print('Run time: %.4fs' % elapsed) -- 2.11.4.GIT