See the discussion on commit 6510292ed80a576b147d4503f4e041726c0e849a ; for running multiple trials, the `timeit` module seems appropriate. The downside is that you can't get the actual output of the function you pass to `timeit`. This context manager is a bit of a compromise between the two, I suppose...