Function to show time to execute another function

Luca Menegotto otlucaDELETE at DELETEyahoo.it
Sun Jun 7 05:44:27 EDT 2015


Il 07/06/2015 11:28, Steven D'Aprano ha scritto:

>
> But if your function takes less than, say, 1 millisecond, then your timing
> results are probably just meaningless random numbers, affected more by the
> other ten thousand processes running on your computer than by the Python
> code itself.

That's a good point. IMHO test the time execution of a function makes 
sense only if all these assetions are true:

- the function takes a long time to be executed;
- the execution is iterated a certain (large) number of times.

-- 
Ciao!
Luca




More information about the Python-list mailing list