I've never tried outputting to screen in a function wrapped in a timeit call, but I suspect the reason is simply because timeit runs your function multiple times in order to give a more accurate estimate of the function time than if you just ran it once with a tic toc. So if you output to the screen in your function it will likely do it however many times timeit runs your function.
Before timeit I used to create my own for loop, call my function many times and take an average, make sure each time had equal conditions and all that, but now timeit takes care of that for you.
Best Answer