I am sure this has been asked before, but I cannot find a similar example. I need to be able to call a function with a temporary runtime. If the function takes this time, then the script completes.
This cannot be done by selecting the whole script! And I want one, little function to be timed. Is it possible?
for instance
def sleep(): time.sleep(60) time("sleep()", limit=30, violation="sys.exit(1)")
A very simple and terrible example that I know, but that might help the explanation.
source share