A package for intentionally lowering performance and generating crashes on React Native applications.
Use blockJavascriptThread and blockNativeMainThread to test your implementation of performance monitoring tools, crashJavascriptThread and crashNativeMainThread to test your implementation of crash reporting tools.
npm install react-native-performance-limiteryarn add react-native-performance-limiterThen re-install your pods:
(cd ios && pod install)import { blockJavascriptThread } from 'react-native-performance-limiter';
blockJavascriptThread(1000); // blocks javascript thread for 1 secondimport { blockNativeMainThread } from 'react-native-performance-limiter';
blockNativeMainThread(1000); // blocks native main thread for 1 secondInside functions you can await for the block to be finised:
const myfun = async () => {
await blockNativeMainThread(1000);
// do something else afterwards
};import { crashJavascriptThread } from 'react-native-performance-limiter';
crashJavascriptThread('custom error message');import { crashNativeMainThread } from 'react-native-performance-limiter';
crashNativeMainThread('custom error message');See the contributing guide to learn how to contribute to the repository and the development workflow.
Made with create-react-native-library