diff --git a/docs/systrace.md b/docs/systrace.md index 9c79d595715..cad816e0af3 100644 --- a/docs/systrace.md +++ b/docs/systrace.md @@ -3,6 +3,127 @@ id: systrace title: Systrace --- +`Systrace` is a standard Android marker-based profiling tool (and is installed when you install the Android platform-tools package). Profiled code blocks are surrounded by start/end markers which are then visualized in a colorful chart format. Both the Android SDK and React Native framework provide standard markers that you can visualize. + +## Example + +`Systrace` allows you to mark JavaScript (JS) events with a tag and an integer value. Capture the non-Timed JS events in EasyProfiler. + +
+ +
+ + + +```SnackPlayer name=Systrace%20Function%20Component%20Example +import React from "react"; +import { Button, Text, View, StyleSheet, Systrace } from "react-native"; + +const App = () => { + + const enableProfiling = () => { + Systrace.setEnabled(true); // Call setEnabled to turn on the profiling. + Systrace.beginEvent('event_label') + Systrace.counterEvent('event_label', 10); + } + + const stopProfiling = () => { + Systrace.endEvent() + } + + return ( + + React Native Systrace API +