I have a package and I hope the first import times are minimal. I used subprocess.check_output to start a new Python process and import modules. However, I just learned that system calls are not included in the total time, so Popen.communicate is fully ignored, as shown below. Is there a recommended way to test the first import time?


I have a package and I hope the first import times are minimal. I used
subprocess.check_outputto start a new Python process and import modules. However, I just learned that system calls are not included in the total time, soPopen.communicateis fully ignored, as shown below. Is there a recommended way to test the first import time?