I needed a tool for a Windows batch script to spawn a child process and waited at most X milliseconds for its completion. Since the “TIMEOUT + TASKKILL” solution waits exactly X milliseconds, I created my own, small solution.
Instead of ping google.com
, simply run
tuxliketimeout.exe 1500 ping google.com
Assuming you have Visual Studio and CMake
installed, first open cmd.exe
and then:
cmake -Bbuild -H.
cmake --build build
The binary will live in build\Debug\tuxliketimeout.exe
.