StartProfiling
From Xojo Documentation
Method
Starts the Code Profiler from gathering profiling information.
Usage
StopProfiling
Notes
This method starts profiling again after the StopProfiling method has been called. You still need to have Profile Code enabled in the Project menu.
If you call StopProfiling in the App.Open event to stop the Code Profiler from profiling all the code in your app then you can then put StartProfiling in only the methods you want to profile.
See Also
StopProfiling method; UserGuide:Code Profiler topic