Benchmarking with Python
Question: I am looking to use Python as a system to benchmark other process's time, data
I/O, correctness, etc. What I am really interested in is the accuracy of the
time. For example

    
    
    start = time()
    subprocess.call('md5sum', somelist)
    end = time()
    print("%d s", end-start)
    

Would the sub process add a considerable overhead to the function being
called.

EDIT

Well after a few quick tests it appears my best option is to use `subprocess`
however I have noted by included stdout/stderr WITH the communicate call it
adds about `0.002338 s` extra time to the execution.


Answer: Use [timeit](http://docs.python.org/2/library/timeit.html)

    
    
    import timeit
    timeit.timeit('yourfunction')
    

**Update**

If you are in linux, then you can use `time` command, like this:

    
    
    import subprocess
    result = subprocess.Popen(['time', 'md5sum', somelist], shell = False, stdout = subprocess.PIPE, stderr = subprocess.PIPE).communicate()
    print result
    

