File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ /**
2+ * Copyright 2013-2014 Facebook, Inc.
3+ *
4+ * Licensed under the Apache License, Version 2.0 (the "License");
5+ * you may not use this file except in compliance with the License.
6+ * You may obtain a copy of the License at
7+ *
8+ * http://www.apache.org/licenses/LICENSE-2.0
9+ *
10+ * Unless required by applicable law or agreed to in writing, software
11+ * distributed under the License is distributed on an "AS IS" BASIS,
12+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ * See the License for the specific language governing permissions and
14+ * limitations under the License.
15+ *
16+ * @providesModule performance
17+ * @typechecks
18+ */
19+
20+ "use strict" ;
21+
22+ var ExecutionEnvironment = require ( 'ExecutionEnvironment' ) ;
23+
24+ var performance ;
25+
26+ if ( ExecutionEnvironment . canUseDOM ) {
27+ performance =
28+ window . performance ||
29+ window . msPerformance ||
30+ window . webkitPerformance ;
31+ }
32+
33+ module . exports = performance || { } ;
Original file line number Diff line number Diff line change 1414 * limitations under the License.
1515 *
1616 * @providesModule performanceNow
17- * @typechecks static-only
17+ * @typechecks
1818 */
1919
20- "use strict" ;
21-
22- var ExecutionEnvironment = require ( 'ExecutionEnvironment' ) ;
20+ var performance = require ( 'performance' ) ;
2321
2422/**
25- * Detect if we can use window.performance.now() and gracefully
26- * fallback to Date.now() if it doesn't exist.
27- * We need to support Firefox < 15 for now due to Facebook's webdriver
28- * infrastructure.
23+ * Detect if we can use `window.performance.now()` and gracefully fallback to
24+ * `Date.now()` if it doesn't exist. We need to support Firefox < 15 for now
25+ * because of Facebook's testing infrastructure.
2926 */
30- var performance = null ;
31-
32- if ( ExecutionEnvironment . canUseDOM ) {
33- performance = window . performance || window . webkitPerformance ;
34- }
35-
3627if ( ! performance || ! performance . now ) {
3728 performance = Date ;
3829}
You can’t perform that action at this time.
0 commit comments