mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Clean up API of PerformanceMark and PerformanceMeasure (#47241)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/47241 Changelog: [internal] The options for the internal constructor of `PerformanceMeasure` shouldn't be optional. This just cleans that up. Reviewed By: rshest Differential Revision: D64480048 fbshipit-source-id: d0275276b11bd329aa2e4667646c67608d562299
This commit is contained in:
committed by
Facebook GitHub Bot
parent
0dcbebd285
commit
1108b4d97b
@@ -218,7 +218,7 @@ export default class Performance {
|
||||
|
||||
const measure = new PerformanceMeasure(measureName, {
|
||||
startTime: computedStartTime,
|
||||
duration: computedDuration,
|
||||
duration: computedDuration ?? 0,
|
||||
detail: options?.detail,
|
||||
});
|
||||
|
||||
|
||||
@@ -25,8 +25,8 @@ export type TimeStampOrName = DOMHighResTimeStamp | string;
|
||||
|
||||
export type PerformanceMeasureInit = {
|
||||
detail?: DetailType,
|
||||
startTime?: DOMHighResTimeStamp,
|
||||
duration?: DOMHighResTimeStamp,
|
||||
startTime: DOMHighResTimeStamp,
|
||||
duration: DOMHighResTimeStamp,
|
||||
};
|
||||
|
||||
export class PerformanceMark extends PerformanceEntry {
|
||||
@@ -53,12 +53,12 @@ export class PerformanceMark extends PerformanceEntry {
|
||||
export class PerformanceMeasure extends PerformanceEntry {
|
||||
#detail: DetailType;
|
||||
|
||||
constructor(measureName: string, measureOptions?: PerformanceMeasureInit) {
|
||||
constructor(measureName: string, measureOptions: PerformanceMeasureInit) {
|
||||
super({
|
||||
name: measureName,
|
||||
entryType: 'measure',
|
||||
startTime: measureOptions?.startTime ?? 0,
|
||||
duration: measureOptions?.duration ?? 0,
|
||||
startTime: measureOptions.startTime,
|
||||
duration: measureOptions.duration,
|
||||
});
|
||||
|
||||
if (measureOptions) {
|
||||
|
||||
Reference in New Issue
Block a user