I have written 2 functions doing the exact same thing, but I don't know which one is faster and better. How do I compare these 2 functions to see which one is better in terms of performance and everything?
The timeit
module will do ya.
来源:https://stackoverflow.com/questions/7956834/how-do-i-compare-python-functions-in-terms-of-performance