File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -86,6 +86,32 @@ function Preview() {
8686}
8787```
8888
89+ ### Performance Metrics
90+
91+ Use ` useLensPerformanceMetrics ` to monitor lens rendering performance:
92+
93+ ``` tsx
94+ import { useLensPerformanceMetrics } from " @snap/react-camera-kit" ;
95+
96+ function PerformanceOverlay() {
97+ const metrics = useLensPerformanceMetrics ({ interval: 500 });
98+
99+ if (! metrics ) return null ;
100+
101+ return (
102+ <div >
103+ <p >FPS: { metrics .avgFps .toFixed (1 )} </p >
104+ <p >Frame time: { metrics .lensFrameProcessingTimeMsAvg .toFixed (1 )} ms</p >
105+ </div >
106+ );
107+ }
108+ ```
109+
110+ The hook accepts:
111+
112+ - ` interval ` (required) — polling interval in milliseconds
113+ - ` enabled ` (optional, defaults to ` true ` ) — set to ` false ` to disable measurement without unmounting
114+
89115## Development
90116
91117``` bash
You can’t perform that action at this time.
0 commit comments