diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-10-20 17:48:35 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-10-20 17:48:35 -0700 |
commit | 2781c7dca6685dbb4519f1bf77c3d3f4611b0f90 (patch) | |
tree | 9777491618399372f9d6cd5bd9644277f5735c6f | |
parent | 67dcc1c8be25b8ec11bb2d7524ae55d89379f478 (diff) |
report times of passes in EMCC_DEBUG
-rwxr-xr-x | emcc | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -74,7 +74,7 @@ emcc can be influenced by a few environment variables: EMMAKEN_COMPILER - The compiler to be used, if you don't want the default clang. ''' -import os, sys, shutil, tempfile, subprocess, shlex +import os, sys, shutil, tempfile, subprocess, shlex, time from subprocess import PIPE, STDOUT from tools import shared from tools.shared import Compression, execute, suffix, unsuffixed, unsuffixed_basename @@ -922,10 +922,15 @@ try: print >> sys.stderr, 'emcc: saving intermediate processing steps to %s' % shared.EMSCRIPTEN_TEMP_DIR intermediate_counter = 0 + intermediate_time = None def save_intermediate(name=None, suffix='js'): - global intermediate_counter + global intermediate_counter, intermediate_time shutil.copyfile(final, os.path.join(shared.EMSCRIPTEN_TEMP_DIR, 'emcc-%d%s.%s' % (intermediate_counter, '' if name is None else '-' + name, suffix))) intermediate_counter += 1 + now = time.time() + if intermediate_time: + print >> sys.stderr, 'emcc: step took %.2f seconds' % (now - intermediate_time) + intermediate_time = now if not LEAVE_INPUTS_RAW: save_intermediate('basebc', 'bc') |