Skip to content

Commit

Permalink
chore(example): print memory and cpu also with jsut 2 fractions
Browse files Browse the repository at this point in the history
  • Loading branch information
hannojg committed Jun 6, 2022
1 parent e09c688 commit 83cf4af
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions example/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {

import PerformanceStats from "react-native-performance-stats";

const DEV_WITH_UI_UPDATES = false;
const DEV_WITH_UI_UPDATES = true;

const App = () => {
const isDarkMode = useColorScheme() === 'dark';
Expand All @@ -26,7 +26,7 @@ const App = () => {

const [stats, setStats] = useState("");
const statsUpdatedCallback = (stats) => {
const statsStr = `UI: ${stats.uiFps.toFixed(2)}fps, JS: ${stats.jsFps.toFixed(2)}fps, Shutters: ${stats.shutters}, RAM: ${stats.usedRam}MB, CPU: ${stats.usedCpu}%\n`;
const statsStr = `UI: ${stats.uiFps.toFixed(2)}fps, JS: ${stats.jsFps.toFixed(2)}fps, Shutters: ${stats.shutters}, mem: ${stats.usedRam.toFixed(2)}MB, CPU: ${stats.usedCpu.toFixed(2)}%\n`;
if (DEV_WITH_UI_UPDATES){
setStats((prev) => {
return prev + statsStr;
Expand Down

0 comments on commit 83cf4af

Please sign in to comment.