3 ms·
I have the current time printed in my prompt, which means I can easily see how long commands took to run, eg: [start time] $ ./run_long_script [ end ti
by coderholic 14y ago
I have the current time printed in my prompt, which means I can easily see how long commands took to run, eg:
[start time] $ ./run_long_script
[ end time ] $
My actual prompt looks like:
[09:36] bmd-mba|bmd ~
$ whoami
bmd
[09:36] bmd-mba|bmd ~
$
Details in https://github.com/coderholic/config/blob/master/.bash_profile https://github.com/coderholic/config/blob/master/.bash_profi...
- dopamean 14y agoIs there a way to do this so the timestamp includes seconds? Thanks.
- p4bl0 14y agoBy default "\t" in your PS1 will display the time the same way `date +%H:%M:%S` does (which includes seconds).
- p4bl0 14y agoActually with that setup (which is a bit like mine) you can see how long it took from the finishing time of the last command you executed (when your PS1 was redisplayed) to the finishing of the command you just executed.