Time Profiling - northern-bites/nbites GitHub Wiki

For Online C++ Code

When you run make atom, set the USE_TIME_PROFILING option to ON. Once our code has run for the number of frames specified in Man.cpp, it will automatically print all of the data it gathered into the nblog. If you ran nao restart && naolog, you will see it automatically. Easy!

For Python

Make sure /usr/lib/python2.6/ contains cProfile.py and pstats.py (Nao NextGen comes with these). Uncomment these imports in Brain.py. Replace this line in Noggin.cpp so that it says "profile" instead of "run." You may also want to change the name of the output file in Brain.profile to a full path so that it is easy to find on the robot.

Now start up the robot and let it run for a given time. Brain.profile has a counter if you want a specific number of frames. This will produce the specified output file, which you can now copy to your own computer.

A good viewer for this file is RunSnakeRun. Run the commands in the Installation section of the RunSnake webpage. Then, to see the profiler output, you can run:

runsnake <path-to-output-file>

This will visualize the profiling data!

##For QTool## Under construction.