0

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. Any leads would be helpful thanks in advance.

MrAdfire
  • 19
  • 6

2 Answers2

0

You can use the time command to get the runtime of the python script.

 ]$ cat time_test.bash
 #!/bin/bash

 # You can use:  time python script.py 
 time python -c 'import os;os.getenv("HOME")'

Output will be something like this

 ]$ ./time_test.bash 

real    0m0.010s
user    0m0.005s
sys 0m0.005s
iamauser
  • 11,119
  • 5
  • 34
  • 52
0

Call the python script with /usr/bin/time script. This allows you to track CPU and wall-clock time of the script.

W.Mann
  • 893
  • 5
  • 11