1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-16 04:45:24 +03:00

remove global access to backgroundPage, optimize eventPage, track application startup time

This commit is contained in:
cTn 2014-10-01 14:08:15 +02:00
parent f9ff34fb8b
commit a580d94d10
2 changed files with 21 additions and 18 deletions

15
main.js
View file

@ -1,13 +1,5 @@
'use strict';
// Get access to the background window object
// This object is used to pass variables between active page and background page
var backgroundPage;
chrome.runtime.getBackgroundPage(function (result) {
backgroundPage = result;
backgroundPage.app_window = window;
});
// Google Analytics
var googleAnalyticsService = analytics.getService('ice_cream_app');
var googleAnalytics = googleAnalyticsService.getTracker('UA-32728876-6');
@ -259,6 +251,13 @@ $(document).ready(function () {
});
});
function catch_startup_time(startTime) {
var endTime = new Date().getTime(),
timeSpent = endTime - startTime;
googleAnalytics.sendTiming('Load Times', 'Application Startup', timeSpent);
}
function microtime() {
var now = new Date().getTime() / 1000;