timelimit

Limit a process's maximum execution time and kill it if exceeded.

brewmacoslinux
Try with needOr install directly
Source

About

Limit a process's absolute execution time

Commands

timelimit

Examples

stop a command after 30 seconds$ timelimit -t 30 long-running-script.sh
run a process with 5 minute timeout$ timelimit -t 300 npm test
kill a hanging process after 10 seconds$ timelimit -t 10 curl http://unresponsive-server.com
prevent infinite loops by setting execution limit$ timelimit -t 60 ./potentially-infinite-loop.py
enforce timeout on build pipeline steps$ timelimit -t 120 docker build -t myimage .