One of the most primitive ways to determine slow points is to hush up the code with print statements. Bottlenecks then appear as delays between prints. This can be improved by printing the system time when moving from one cycle to another, which makes it trivial to determine the slowest cycles.
A solution that is potentially simpler and more thorough is to use a performance profiler. Most major languages ββwill have standalone profilers or debuggers with built-in performance profiling. A good profiler will determine the percentage of run time spent on each area of ββyour code and provide useful information for optimizing performance bottlenecks.
If you need more specific information, it would be helpful to publish the language you are using, as well as the relevant sections of the code.
source share