diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-08-19 10:32:21 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-08-19 10:32:21 -0700 |
commit | cc8297b311c8deaf6bf991796f93b3177ff94cd1 (patch) | |
tree | 08f4fbcac84e6113a88b5184d81de4e4822cda72 /src | |
parent | 745cbe466448395587ecb5214087bac19c9b1cbe (diff) |
emit preload timing
Diffstat (limited to 'src')
-rw-r--r-- | src/postamble.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/postamble.js b/src/postamble.js index 08c3a9d8..d6a452f8 100644 --- a/src/postamble.js +++ b/src/postamble.js @@ -11,12 +11,18 @@ ExitStatus.prototype.constructor = ExitStatus; var initialStackTop; +var preloadStartTime = null; + Module['callMain'] = Module.callMain = function callMain(args) { assert(runDependencies == 0, 'cannot call main when async dependencies remain! (listen on __ATMAIN__)'); assert(__ATPRERUN__.length == 0, 'cannot call main when preRun functions remain to be called'); args = args || []; + if (preloadStartTime !== null) { + Module.printErr('preload time: ' + (Date.now() - preloadStartTime) + ' ms'); + } + ensureInitRuntime(); var argc = args.length+1; @@ -72,6 +78,8 @@ Module['callMain'] = Module.callMain = function callMain(args) { function run(args) { args = args || Module['arguments']; + if (preloadStartTime === null) preloadStartTime = Date.now(); + if (runDependencies > 0) { Module.printErr('run() called, but dependencies remain, so not running'); return; |