diff options
author | Ruben Rodriguez <ruben@fsf.org> | 2018-05-11 16:23:03 -0400 |
---|---|---|
committer | Ruben Rodriguez <ruben@fsf.org> | 2018-05-11 16:23:03 -0400 |
commit | 107d7ebdd42061cd16fd9a00edd4fd4201ba59a2 (patch) | |
tree | f8e9f8eab19b49c4741d294a41cf7ed7fd35b54a | |
parent | 522a6fccddcdeaaf6ae4adbb984f4636b31bdb8c (diff) |
Add basic time profiling to dbg_print
-rw-r--r-- | main_background.js | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/main_background.js b/main_background.js index 518901d..16b58d3 100644 --- a/main_background.js +++ b/main_background.js @@ -35,9 +35,11 @@ console.log("main_background.js"); */ var DEBUG = false; // debug the JS evaluation var PRINT_DEBUG = false; // Everything else +var time = Date.now(); function dbg_print(a,b){ if(PRINT_DEBUG == true){ + console.log("Time spent so far: " + (Date.now() - time)/1000 + " seconds"); if(b === undefined){ console.log(a); } else{ @@ -1271,6 +1273,7 @@ function read_document(a){ dbg_print("%c Error in getting document","color:red"); } filter.onstop = event => { + time = Date.now(); delete unused_data[a["tabId"]]; webex.browserAction.setBadgeText({ text: "✓", |