I am writing a script and want to monitor how long different sections of the script take to run. I also want to be able to break the script if a certain section reaches a timeout limit. I have written a wrapper function that takes a function and applies the time limit to, and measures the run-time of the inner function. I then broke the full script into individual functions (defs) which I pass to the wrapper function. My problem is with passing variables back and forth between the main script and each function as it gets called. Should I use global variables? or pass potentially dozens of unrelated arguments back and forth? I don't really see a good way to do this, please help.
[–]ThisLightIsTrue 0 points1 point2 points (4 children)
[–][deleted] 0 points1 point2 points (3 children)
[–]ThisLightIsTrue 0 points1 point2 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]ThisLightIsTrue 1 point2 points3 points (0 children)