timeout is Unix and Linux Command Line Interfacetool. It allows the user to stop (timeout) a command after a set amount of time has passed.

We can use htop for 30 seconds:

timeout 30s htop