for module in next_possible_modules: import math; math.factorial(40000) # approx. a 1 second operation end_time = start_time + timedelta(minutes=module.duration)