aboutsummaryrefslogtreecommitdiff
path: root/emcc
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-10-20 17:48:35 -0700
committerAlon Zakai <alonzakai@gmail.com>2012-10-20 17:48:35 -0700
commit2781c7dca6685dbb4519f1bf77c3d3f4611b0f90 (patch)
tree9777491618399372f9d6cd5bd9644277f5735c6f /emcc
parent67dcc1c8be25b8ec11bb2d7524ae55d89379f478 (diff)
report times of passes in EMCC_DEBUG
Diffstat (limited to 'emcc')
-rwxr-xr-xemcc9
1 files changed, 7 insertions, 2 deletions
diff --git a/emcc b/emcc
index ae72039a..fa00bb52 100755
--- a/emcc
+++ b/emcc
@@ -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')