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!