I am developing an online judge for my university. I need to timeout every program after 5 seconds for measuring time limit. my input is input.txt file and i am compiling and getting output in ubuntu by these commands
g++ -lm tle.cpp
timeout 5s a.exe < input.txt
These commands allow cpu to run programs for only 5 seconds. Now I need equivalent commands for Windows cmd.
Edit :
This Question is different from previous one as windows timeout process is different from ubuntu timeout process. Windows timeout process just waits but not set a definite time for execution. if execution is done before timeout then windows timeout still waits where ubuntu timeout set a definite time for program execution and terminates after execution but does not wait though program is terminated. So i want to stop waiting if execution is finished.