The built-in profiler allows you to analyze the performance of your scripts by measuring execution time of different functions and event handlers.
The profiler can be accessed through the FiveM debug menu or by using the console command.
- Function Timing: See how long each function takes to execute
- Event Analysis: Monitor event handler performance
- Memory Usage: Track memory allocation during execution
- Call Stacks: View detailed call hierarchies
- Enable the profiler before running the code you want to analyze
- Run your script for a representative period
- Stop the profiler and review the results
- Focus on functions with the highest total time or most calls
For detailed technical information, see the about the profiler.