diff --git a/toolkit/mozapps/extensions/AddonManager.jsm b/toolkit/mozapps/extensions/AddonManager.jsm index 7247446b44f1..a45831c5f6c6 100644 --- a/toolkit/mozapps/extensions/AddonManager.jsm +++ b/toolkit/mozapps/extensions/AddonManager.jsm @@ -2431,9 +2431,9 @@ this.AddonManagerPrivate = { // Start a timer, record a simple measure of the time interval when // timer.done() is called simpleTimer: function(aName) { - let startTime = Date.now(); + let startTime = Cu.now(); return { - done: () => this.recordSimpleMeasure(aName, Date.now() - startTime) + done: () => this.recordSimpleMeasure(aName, Math.round(Cu.now() - startTime)) }; }, diff --git a/toolkit/mozapps/extensions/internal/XPIProvider.jsm b/toolkit/mozapps/extensions/internal/XPIProvider.jsm index 69c6fb09467d..bfdcc1f868c7 100644 --- a/toolkit/mozapps/extensions/internal/XPIProvider.jsm +++ b/toolkit/mozapps/extensions/internal/XPIProvider.jsm @@ -1494,7 +1494,7 @@ XPIState.prototype = { */ getModTime(aFile, aId) { let changed = false; - let scanStarted = Date.now(); + let scanStarted = Cu.now(); // For an unknown or enabled add-on, we do a full recursive scan. if (!('scanTime' in this) || this.enabled) { logger.debug('getModTime: Recursive scan of ' + aId); @@ -1539,7 +1539,7 @@ XPIState.prototype = { } } // Record duration of file-modified check - XPIProvider.setTelemetry(aId, "scan_MS", Date.now() - scanStarted); + XPIProvider.setTelemetry(aId, "scan_MS", Math.round(Cu.now() - scanStarted)); return changed; }, @@ -3539,10 +3539,10 @@ this.XPIProvider = { } // Telemetry probe added around getInstallState() to check perf - let telemetryCaptureTime = Date.now(); + let telemetryCaptureTime = Cu.now(); let installChanged = XPIStates.getInstallState(); let telemetry = Services.telemetry; - telemetry.getHistogramById("CHECK_ADDONS_MODIFIED_MS").add(Date.now() - telemetryCaptureTime); + telemetry.getHistogramById("CHECK_ADDONS_MODIFIED_MS").add(Math.round(Cu.now() - telemetryCaptureTime)); if (installChanged) { updateReasons.push("directoryState"); }