Popen subprocess profiling calls in Python

I have a program that calls several external scripts using popen from a subprocess. Now I want to profile this program. Although I can easily profile python code with cProfile, I don't get any information about how long various external scripts have been running.

I want to avoid making every single call with a timer.

Thanks!

+4
source share
1 answer

As Simeon said, you just need to write the time code once. The way to do this is to decorate the popen function.

+1
source

All Articles