Capture run time of python script executed inside shell script

I have bash shell script which is internally calling python script.I would like to know how long python is taking to execute.I am not allowed to do changes in python script.Please note i need to know execution time of python script which is getting executed inside shell .I need to store execution time in variable.Any leads would be helpful thanks in advance.

Does this mean you can "time" the python only in production runs and on a production machine? With no changes. No way that I know.

Try this

python -m cProfile myscript.py

from your command line in a non-production environment. Like where you develop and unit test your code.

Did you consider time ? man time :