Measuring elapsed time with the Time module

start_time = time.time() # your code elapsed_time = time.time() – start_time You can also write simple decorator to simplify measurement of execution time of various functions: import time from functools import wraps PROF_DATA = {} def profile(fn): @wraps(fn) def with_profiling(*args, **kwargs): start_time = time.time() ret = fn(*args, **kwargs) elapsed_time = time.time() – start_time if fn.__name__ … Read more