I have a script (it's a hadoop pig script to b precice) from which I want to measure the execution time. I might planned to run the tests several times and take the average / median time as the execution time.
As starting the script several times by hand might get quite cumbersome, I wanted to write a script for running these tests.
Is it a good idea to use Python's Popen to start a new process that executes the script and measure the time that process is running, say:
# start timer
p = subprocess.Popen(...)
stdout, stderr = p.communicate()
# end timer
Does creating a new process skew the results in time measurements, or is this apporoach fine? Any other suggestions?
Best, Will