I’m trying to develop a test case for a program, and would like to fail the test case if it runs over 4 seconds.
How can this be done on linux? (I’m using Ubuntu)
I know I can time the execution and fail it time > 4, but that’s just a bad approach.
Thanks!
(shell script solution)
Runs your testcase in background, get the PId of it, and checks after 4 seconds if the process is still running.