Use the timeit module. It's very easy. Run your example.py file so it is active in the Python Shell, you should now be able to call your function in the shell. Try it out to check it works
>>>fun(input)
output
Good, that works, now import timeit and set up a timer
>>>import timeit
>>>t = timeit.Timer('example.fun(input)','import example')
>>>
Now we have our timer set up we can see how long it takes
>>>t.timeit(number=1)
some number here
And there we go, it will tell you how many seconds (or less) it took to execute that function. If it's a simple function then you can increase it to t.timeit(number=1000) (or any number!) and then divide the answer by the number to get the average.
I hope this helps.