aboutsummaryrefslogtreecommitdiff
path: root/src/postamble.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/postamble.js')
-rw-r--r--src/postamble.js8
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;