Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions example/modules/frame-metrics/src/index.web.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
export type FrameMetricsResult = {
avgUiThreadTime: number;
p95UiThreadTime: number;
p99UiThreadTime: number;
avgAnimationTime?: number;
avgLayoutTime?: number;
avgDrawTime?: number;
};

export const isAndroid = false;

export function startCollecting(): void {
// no-op on web
}

export function stopCollecting(): FrameMetricsResult {
return {
avgUiThreadTime: 0,
p95UiThreadTime: 0,
p99UiThreadTime: 0,
};
}
1 change: 1 addition & 0 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"android": "expo run:android",
"ios": "expo run:ios",
"start": "expo start",
"web": "expo start --web",
"prebuild": "expo prebuild",
"build:android": "expo prebuild --platform android --clean && cd android && ./gradlew assembleDebug --no-daemon --console=plain -PreactNativeArchitectures=arm64-v8a",
"build:ios": "expo prebuild --platform ios --clean && xcodebuild -workspace ios/EaseExample.xcworkspace -scheme EaseExample -configuration Debug -sdk iphonesimulator -arch x86_64 build"
Expand Down
15 changes: 10 additions & 5 deletions example/src/demos/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { ComponentType } from 'react';
import { Platform } from 'react-native';

import { BackgroundColorDemo } from './BackgroundColorDemo';
import { BenchmarkDemo } from './BenchmarkDemo';
Expand Down Expand Up @@ -79,11 +80,15 @@ export const demos: Record<string, DemoEntry> = {
title: 'Comparison',
section: 'Advanced',
},
'benchmark': {
component: BenchmarkDemo,
title: 'Benchmark',
section: 'Advanced',
},
...(Platform.OS !== 'web'
? {
benchmark: {
component: BenchmarkDemo,
title: 'Benchmark',
section: 'Advanced',
},
}
: {}),
};

interface SectionData {
Expand Down
Loading