How can i get the simulation statistics with python

I found a script example to limit the FPS of the simulation, i will try to get fps base on that script