I would like to call a func and stop it from running after one minute, returning a value. i have a code that looks similar to that:
def foo(txt):
best_value=-1
for word in txt:
if value(word)>best_value:
best_value=value(world)
return best_value
i would like to stop running after one minute and return best_value. thanks for your help.