timelimit

Limit a process's absolute execution time with a hard timeout

brewmacoslinux
Try with needOr install directly
Source

About

Limit a process's absolute execution time

Commands

timelimit

Examples

Run a command with a 30-second timeout$ timelimit -t 30 ./long_running_script.sh
Set a 5-minute timeout with a warning at 4 minutes$ timelimit -t 300 -s SIGTERM ./backup_job.sh
Limit a compilation process to 10 minutes$ timelimit -t 600 make build