Killrs is a very simple threshold based process killer. Use it only for experimentation as killing a process can lead to unexpected results.
cargo install --git https://github.com/vitrioil/killrs
Provide the pid, threshold and what resource to monitor.
killrs --help
Example: To restrict the process running more than 100 seconds
killrs --pid <pid> --threshold 100 run-time
It will send SIGINT to begin with, but if the process still exists it will escalate it to SIGTERM and then SIGKILL.
Run example:
cargo run --example simple
It uses sysinfo to gather system information.