aboutsummaryrefslogtreecommitdiff
path: root/src/library_browser.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-09-11 19:28:48 -0700
committerAlon Zakai <alonzakai@gmail.com>2012-09-11 19:28:48 -0700
commitafa818a5cbc78bb862f0cae8b305c8033a5b0fc3 (patch)
tree7a96bfc921999e177f2d3e997df58a72cf410b9a /src/library_browser.js
parent24e61522f29d3796c0a1d2736d6008006b2e4ad6 (diff)
parentb37876be6ebf3da38b657e413c80fc6d69560b76 (diff)
Merge branch 'incoming'
Diffstat (limited to 'src/library_browser.js')
-rw-r--r--src/library_browser.js21
1 files changed, 6 insertions, 15 deletions
diff --git a/src/library_browser.js b/src/library_browser.js
index bf235493..43732e5b 100644
--- a/src/library_browser.js
+++ b/src/library_browser.js
@@ -379,12 +379,6 @@ mergeInto(LibraryManager.library, {
emscripten_set_main_loop: function(func, fps) {
Module['noExitRuntime'] = true;
-#if PROFILE_MAIN_LOOP
- Module['totalTime'] = 0;
- Module['iterations'] = 0;
- Module['maxTime'] = 0;
-#endif
-
var jsFunc = FUNCTION_TABLE[func];
Browser.mainLoop.runner = function() {
if (Browser.mainLoop.queue.length > 0) {
@@ -414,18 +408,15 @@ mergeInto(LibraryManager.library, {
return;
}
-#if PROFILE_MAIN_LOOP
- var start = performance.now();
-#endif
+ if (Module['preMainLoop']) {
+ Module['preMainLoop']();
+ }
jsFunc();
-#if PROFILE_MAIN_LOOP
- var time = performance.now() - start;
- Module['totalTime'] += time;
- Module['iterations']++;
- Module['maxTime'] = Math.max(Module['maxTime'], time);
-#endif
+ if (Module['postMainLoop']) {
+ Module['postMainLoop']();
+ }
if (Browser.mainLoop.shouldPause) {
// catch pauses from the main loop itself