tcsh, there's the variable
The time shell variable can be set to execute the time builtin command after the completion of any process that takes more than a given number of CPU seconds.
How do I do this in
I don't think you can achieve exactly the same effect without modifying the bash source. But you can get close, hopefully close enough for you.
You can combine bash's hacky precommand hook and the
To get the full
When you press Ctrl+J instead of Enter to start a command, you'll get time information. Rebinding Enter (i.e. Ctrl+M) is not recommended because the modified command will sometimes be syntactically incorrect.
See How can the last command's wall time be put in the Bash prompt? and Automatically timing every executed command and show in Bash prompt? on Stack Overflow for other methods (note however that most only give the elapsed real time, not the CPU time).