I am currently trying to create a small test application for various programming tasks. It will run an executable file that will generate output in another file, and then compare it with the answer. At the moment, I think I can easily, but I have a problem ...
I want to limit the execution time of this executable file, for example, 1 second or 2 seconds. Therefore, I was wondering if there is an option that stops / issues the program if the time limit is reached.
Currently, the operating system is not a problem, it can be windows or Linux, although I still switch the program to linux later, so it would be better if someone could give me some hint on how to do this.
โChatterโ is enough, and Iโll just ask the question: Is there a way to set a time limit on how long a program can run on Linux or Windows?
source share