diff --git a/apps/common-app/src/apps/reanimated/examples/SystraceSectionExample.tsx b/apps/common-app/src/apps/reanimated/examples/SystraceSectionExample.tsx new file mode 100644 index 000000000000..8eed6bf1158d --- /dev/null +++ b/apps/common-app/src/apps/reanimated/examples/SystraceSectionExample.tsx @@ -0,0 +1,39 @@ +import { Button, StyleSheet, Text, View } from 'react-native'; + +import React from 'react'; +import { scheduleOnUI } from 'react-native-worklets'; + +declare global { + var _beginSection: (name: string) => void; + var _endSection: () => void; +} + +function handlePress() { + scheduleOnUI(() => { + globalThis._beginSection('SystraceSectionExample'); + const start = performance.now(); + // eslint-disable-next-line no-empty + while (performance.now() - start < 1000) {} + globalThis._endSection(); + }); +} + +export default function SystraceSectionExample() { + return ( + + Hello world! +