Timeout on a Python function call inside timeit
问题 I have a function, let's call it my_function(*args, **kwargs) , that depending on the arguments passed to it takes anywhere from 30 seconds to many many hours (days). I have a list of different arguments and I want to know how long the functions will take given the arguments. I am still very new to using timeit , but I have learn enough to do this part; however, this wouldn't be the very efficient for my purposes. Any set of arguments that take longer than 4 hours to complete are consider