The built-in profiler allows you to analyze the performance of your scripts by measuring execution time of different functions and event handlers.
Accessing the Profiler
The profiler can be accessed through the FiveM debug menu or by using the profile console command.
Key Features
- 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
Usage Tips
- 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 forum topic about the profiler.