I am implementing a C ++ validation system. It runs executable files with various tests. If the solution is not correct, it may require endless completion with certain stringent tests. So I want to limit the runtime to 5 seconds.
I use the system () function to run executable files:
system("./solution");
.NET has an excellent WaitForExit() method, but what about native C ++ ?. I also use Qt, so Qt based solutions are welcome.
So, is there a way to limit the runtime of an external process to 5 seconds?
thanks
source share