Skip to content

Commit

Permalink
Use nativeQPLTimestamp for InitializeCore marker point
Browse files Browse the repository at this point in the history
Summary: It seems like `nativePerformanceNow` might not be getting installed in time to be used by InitializeCore on Android. Using PerformanceLogger.currentTimestamp instead, which uses nativeQPLTimestamp (which is what we should be using anyway)

Reviewed By: alexeylang

Differential Revision: D12875187

fbshipit-source-id: 6eda5d2ed7948ba48c63f76b40b2014511c32494
  • Loading branch information
Emily Janzer authored and facebook-github-bot committed Nov 9, 2018
1 parent df7e8c6 commit 1850906
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions Libraries/Core/InitializeCore.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
*/
'use strict';

const startTime =
global.nativePerformanceNow != null ? global.nativePerformanceNow() : null;
const start = Date.now();

require('setUpGlobals');
require('polyfillES6Collections');
Expand All @@ -45,8 +44,12 @@ if (__DEV__) {
require('setUpDeveloperTools');
}

if (startTime != null) {
const PerformanceLogger = require('PerformanceLogger');
PerformanceLogger.markPoint('initializeCore_start', startTime);
PerformanceLogger.markPoint('initializeCore_end');
}
const PerformanceLogger = require('PerformanceLogger');
// We could just call PerformanceLogger.markPoint at the top of the file,
// but then we'd be excluding the time it took to require PerformanceLogger.
// Instead, we just use Date.now and backdate the timestamp.
PerformanceLogger.markPoint(
'initializeCore_start',
PerformanceLogger.currentTimestamp() - (Date.now() - start),
);
PerformanceLogger.markPoint('initializeCore_end');

0 comments on commit 1850906

Please sign in to comment.