diff --git a/docs/systrace.md b/docs/systrace.md index 9aa54fe8e18..c6fda4d290d 100644 --- a/docs/systrace.md +++ b/docs/systrace.md @@ -7,20 +7,16 @@ title: Systrace ## Example -`Systrace` allows you to mark JavaScript (JS) events with a tag and an integer value. Capture the non-Timed JS events in EasyProfiler. +`Systrace` allows you to mark JavaScript (JS) events with a tag and an integer value. Start profiling with an Android profiling tool such as Perfetto or EasyProfiler, then use these markers to identify the events in the captured trace. ```SnackPlayer name=Systrace%20Example import {Button, Text, View, StyleSheet, Systrace} from 'react-native'; import {SafeAreaView, SafeAreaProvider} from 'react-native-safe-area-context'; const App = () => { - const enableProfiling = () => { - Systrace.setEnabled(true); // Call setEnabled to turn on the profiling. + const markEvent = () => { Systrace.beginEvent('event_label'); Systrace.counterEvent('event_label', 10); - }; - - const stopProfiling = () => { Systrace.endEvent(); }; @@ -31,15 +27,7 @@ const App = () => { React Native Systrace API -